Skip to content

Commit

Permalink
Fixing phpunit class aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyharris committed Jun 24, 2017
1 parent 661bec0 commit 33387ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/TestSuite/Fixture/FixtureInjector.php
Expand Up @@ -19,11 +19,6 @@
trigger_error(sprintf('Your PHPUnit Version must be at least 5.7.0 to use CakePHP Testsuite, found %s', \PHPUnit_Runner_Version::id()), E_USER_ERROR);
}
class_alias('PHPUnit_Framework_Test', 'PHPUnit\Framework\Test');
class_alias('PHPUnit_Framework_Warning', 'PHPUnit\Framework\Warning');

if (!class_exists('PHPUnit\Framework\TestSuite')) {
class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit\Framework\TestSuite');
}
}

use Cake\TestSuite\TestCase;
Expand Down
3 changes: 2 additions & 1 deletion src/TestSuite/TestSuite.php
Expand Up @@ -16,11 +16,12 @@
*/
namespace Cake\TestSuite;

if (class_exists('PHPUnit_Runner_Version') && !class_exists('PHPUnit\Framework\TestSuite')) {
if (class_exists('PHPUnit_Runner_Version')) {
if (version_compare(\PHPUnit_Runner_Version::id(), '5.7', '<')) {
trigger_error(sprintf('Your PHPUnit Version must be at least 5.7.0 to use CakePHP Testsuite, found %s', \PHPUnit_Runner_Version::id()), E_USER_ERROR);
}
class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit\Framework\TestSuite');
class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
}

use Cake\Filesystem\Folder;
Expand Down

0 comments on commit 33387ef

Please sign in to comment.