Skip to content

Commit 221e4fa

Browse files
committed
At Zend_Test_PHPUnit_ControllerTestCase, added a class alias for Yoast\PHPUnitPolyfills\TestCases\TestCase or PHPUnit\Framework\TestCase, thus enabling the use of this class in any PHPUnit version, and thus any PHP version.
1 parent dbdd481 commit 221e4fa

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

library/Zend/Test/PHPUnit/ControllerTestCase.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
/** @see Zend_Registry */
3535
require_once 'Zend/Registry.php';
3636

37+
if (!class_exists('PHPUnit_Framework_TestCase')) {
38+
if (class_exists('Yoast\PHPUnitPolyfills\TestCases\TestCase')) {
39+
class_alias('Yoast\PHPUnitPolyfills\TestCases\TestCase', 'PHPUnit_Framework_TestCase');
40+
} elseif (class_exists('PHPUnit\Framework\TestCase')) {
41+
class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
42+
}
43+
}
44+
3745
/**
3846
* Functional testing scaffold for MVC applications
3947
*

tests/Zend/Layout/AllTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function suite()
5555
$suite->addTestSuite('Zend_Layout_LayoutTest');
5656
$suite->addTestSuite('Zend_Layout_HelperTest');
5757
$suite->addTestSuite('Zend_Layout_PluginTest');
58-
// $suite->addTestSuite('Zend_Layout_FunctionalTest');
58+
$suite->addTestSuite('Zend_Layout_FunctionalTest');
5959

6060
return $suite;
6161
}

0 commit comments

Comments
 (0)