test: phpunit command does not use TestShell, HtmlCoverageReport. So skip test.

This commit is contained in:
Koji Tanaka 2023-01-07 12:19:03 +09:00 committed by Kamil Wylegala
parent 2a7c06e16f
commit b1138db8f4
2 changed files with 10 additions and 0 deletions

View file

@ -49,6 +49,11 @@ class TestShellTest extends CakeTestCase {
* @return void * @return void
*/ */
public function setUp() : 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(); parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false); $out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false); $in = $this->getMock('ConsoleInput', array(), array(), '', false);

View file

@ -34,6 +34,11 @@ class HtmlCoverageReportTest extends CakeTestCase {
* @return void * @return void
*/ */
public function setUp() : 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(); parent::setUp();
App::build(array( App::build(array(
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)