Skip to content

Commit

Permalink
At Zend_Test_PHPUnit_ControllerTestCase, added a class alias for Yoas…
Browse files Browse the repository at this point in the history
…t\PHPUnitPolyfills\TestCases\TestCase or PHPUnit\Framework\TestCase, thus enabling the use of this class in any PHPUnit version, and thus any PHP version.
  • Loading branch information
boenrobot committed Feb 2, 2024
1 parent dbdd481 commit 221e4fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions library/Zend/Test/PHPUnit/ControllerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
/** @see Zend_Registry */
require_once 'Zend/Registry.php';

if (!class_exists('PHPUnit_Framework_TestCase')) {
if (class_exists('Yoast\PHPUnitPolyfills\TestCases\TestCase')) {
class_alias('Yoast\PHPUnitPolyfills\TestCases\TestCase', 'PHPUnit_Framework_TestCase');
} elseif (class_exists('PHPUnit\Framework\TestCase')) {
class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
}
}

/**
* Functional testing scaffold for MVC applications
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Layout/AllTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static function suite()
$suite->addTestSuite('Zend_Layout_LayoutTest');
$suite->addTestSuite('Zend_Layout_HelperTest');
$suite->addTestSuite('Zend_Layout_PluginTest');
// $suite->addTestSuite('Zend_Layout_FunctionalTest');
$suite->addTestSuite('Zend_Layout_FunctionalTest');

return $suite;
}
Expand Down

0 comments on commit 221e4fa

Please sign in to comment.