diff --git a/lib/Cake/Test/Case/Console/Command/TestShellTest.php b/lib/Cake/Test/Case/Console/Command/TestShellTest.php index d9815ed85..46a4d64f6 100644 --- a/lib/Cake/Test/Case/Console/Command/TestShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/TestShellTest.php @@ -49,6 +49,11 @@ class TestShellTest extends CakeTestCase { * @return void */ public function setUp() : void { + // This test can not be run with PHPUnit 9+. + // Because TestShell and CakeTestLoader depend on PHPUnit_Runner_StandardTestSuiteLoader. + // If run the test with the phpunit command, TestSuite Loader is also PHPUnit's to be used. + // Therefore, TestShell and CakeTestLoader are unnecessary. + $this->skipIf(version_compare(\PHPUnit\Runner\Version::id(), '9.0.0', '>='), 'This test can not be run with PHPUnit 9+'); parent::setUp(); $out = $this->getMock('ConsoleOutput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false); diff --git a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php index 2c418891e..d8299e0ed 100644 --- a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php +++ b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php @@ -34,6 +34,11 @@ class HtmlCoverageReportTest extends CakeTestCase { * @return void */ public function setUp() : void { + // This test can not be run with PHPUnit 9+. + // Because CakeBaseReporter depend on PHPUnit_TextUI_ResultPrinter. + // If run the test with the phpunit command, Result Printer is also PHPUnit's to be used. + // Therefore, CakeBaseReporter are unnecessary. + $this->skipIf(version_compare(\PHPUnit\Runner\Version::id(), '9.0.0', '>='), 'This test can not be run with PHPUnit 9+'); parent::setUp(); App::build(array( 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)