Skip to content

Commit

Permalink
updated shim
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Jan 10, 2018
1 parent a92425a commit 333505a
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions src/shim.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
<?php
if (!class_exists('PHPUnit_Framework_TestCase') && class_exists('PHPUnit\Framework\TestCase')) {
class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
class_alias('PHPUnit\Runner\Version', 'PHPUnit_Runner_Version');
if (!class_exists('PHPUnit\Framework\TestCase') && class_exists('PHPUnit_Framework_TestCase')) {
class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\Framework\TestCase');
}

if (!class_exists('PHPUnit\Runner\Version')) {
class_alias('PHPUnit_Runner_Version', 'PHPUnit\Runner\Version');
}
if (!class_exists('PHPUnit\Framework\MockObject\Generator')) {
class_alias('PHPUnit\Framework\MockObject\Generator', 'PHPUnit_Framework_MockObject_Generator');
class_alias('PHPUnit\Framework\MockObject\InvocationMocker', 'PHPUnit_Framework_MockObject_InvocationMocker');
class_alias('PHPUnit\Framework\MockObject\Invokable', 'PHPUnit_Framework_MockObject_Invokable');
class_alias('PHPUnit\Framework\MockObject\Matcher', 'PHPUnit_Framework_MockObject_Matcher');
class_alias('PHPUnit\Framework\MockObject\MockBuilder', 'PHPUnit_Framework_MockObject_MockBuilder');
if (!interface_exists('PHPUnit_Framework_MockObject_MockObject')) {
class_alias('PHPUnit_Framework_MockObject_Generator', 'PHPUnit\Framework\MockObject\Generator');
class_alias('PHPUnit_Framework_MockObject_InvocationMocker', 'PHPUnit\Framework\MockObject\InvocationMocker');
class_alias('PHPUnit_Framework_MockObject_Invokable', 'PHPUnit\Framework\MockObject\Invokable');
class_alias('PHPUnit_Framework_MockObject_Matcher', 'PHPUnit\Framework\MockObject\Matcher');
class_alias('PHPUnit_Framework_MockObject_MockBuilder', 'PHPUnit\Framework\MockObject\MockBuilder');
if (interface_exists('PHPUnit_Framework_MockObject_MockObject')) {
/*
* old name still exists in https://github.com/sebastianbergmann/phpunit-mock-objects/blob/master/src/MockObject.php
* but namespaced alias is provided by https://github.com/sebastianbergmann/phpunit-mock-objects/blob/master/src/ForwardCompatibility/MockObject.php
*/
class_alias('PHPUnit\Framework\MockObject\MockObject', 'PHPUnit_Framework_MockObject_MockObject');
class_alias('PHPUnit_Framework_MockObject_MockObject', 'PHPUnit\Framework\MockObject\MockObject');
}
class_alias('PHPUnit\Framework\MockObject\Stub', 'PHPUnit_Framework_MockObject_Stub');
class_alias('PHPUnit\Framework\MockObject\Verifiable', 'PHPUnit_Framework_MockObject_Verifiable');
class_alias('PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount', 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount');
class_alias('PHPUnit\Framework\MockObject\Matcher\ConsecutiveParameters', 'PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters');
class_alias('PHPUnit\Framework\MockObject\Matcher\Invocation', 'PHPUnit_Framework_MockObject_Matcher_Invocation');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex', 'PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastCount', 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastOnce', 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedAtMostCount', 'PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedCount', 'PHPUnit_Framework_MockObject_Matcher_InvokedCount');
class_alias('PHPUnit\Framework\MockObject\Matcher\InvokedRecorder', 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder');
class_alias('PHPUnit\Framework\MockObject\Matcher\MethodName', 'PHPUnit_Framework_MockObject_Matcher_MethodName');
class_alias('PHPUnit\Framework\MockObject\Matcher\Parameters', 'PHPUnit_Framework_MockObject_Matcher_Parameters');
class_alias('PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls', 'PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls');
class_alias('PHPUnit\Framework\MockObject\Stub\Exception', 'PHPUnit_Framework_MockObject_Stub_Exception');
class_alias('PHPUnit\Framework\MockObject\Stub\ReturnArgument', 'PHPUnit_Framework_MockObject_Stub_ReturnArgument');
class_alias('PHPUnit\Framework\MockObject\Stub\ReturnCallback', 'PHPUnit_Framework_MockObject_Stub_ReturnCallback');
class_alias('PHPUnit\Framework\MockObject\Stub\ReturnStub', 'PHPUnit_Framework_MockObject_Stub_Return');
class_alias('PHPUnit_Framework_MockObject_Stub', 'PHPUnit\Framework\MockObject\Stub');
class_alias('PHPUnit_Framework_MockObject_Verifiable', 'PHPUnit\Framework\MockObject\Verifiable');
class_alias('PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount', 'PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount');
class_alias('PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters', 'PHPUnit\Framework\MockObject\Matcher\ConsecutiveParameters');
class_alias('PHPUnit_Framework_MockObject_Matcher_Invocation', 'PHPUnit\Framework\MockObject\Matcher\Invocation');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex', 'PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount', 'PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastCount');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce', 'PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastOnce');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount', 'PHPUnit\Framework\MockObject\Matcher\InvokedAtMostCount');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedCount', 'PHPUnit\Framework\MockObject\Matcher\InvokedCount');
class_alias('PHPUnit_Framework_MockObject_Matcher_InvokedRecorder', 'PHPUnit\Framework\MockObject\Matcher\InvokedRecorder');
class_alias('PHPUnit_Framework_MockObject_Matcher_MethodName', 'PHPUnit\Framework\MockObject\Matcher\MethodName');
class_alias('PHPUnit_Framework_MockObject_Matcher_Parameters', 'PHPUnit\Framework\MockObject\Matcher\Parameters');
class_alias('PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls', 'PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls');
class_alias('PHPUnit_Framework_MockObject_Stub_Exception', 'PHPUnit\Framework\MockObject\Stub\Exception');
class_alias('PHPUnit_Framework_MockObject_Stub_ReturnArgument', 'PHPUnit\Framework\MockObject\Stub\ReturnArgument');
class_alias('PHPUnit_Framework_MockObject_Stub_ReturnCallback', 'PHPUnit\Framework\MockObject\Stub\ReturnCallback');
class_alias('PHPUnit_Framework_MockObject_Stub_Return', 'PHPUnit\Framework\MockObject\Stub\ReturnStub');
}

0 comments on commit 333505a

Please sign in to comment.