diff --git a/ChangeLog-5.7.md b/ChangeLog-5.7.md index bdd0723c6a5..dd4e4bc25b3 100644 --- a/ChangeLog-5.7.md +++ b/ChangeLog-5.7.md @@ -7,6 +7,8 @@ All notable changes of the PHPUnit 5.7 release series are documented in this fil ### Fixed * Fixed [#2236](https://github.com/sebastianbergmann/phpunit/issues/2236): Exceptions in `tearDown()` do not affect `getStatus()` +* Fixed [#2950](https://github.com/sebastianbergmann/phpunit/issues/2950): Class extending `PHPUnit\Framework\TestSuite` does not extend `PHPUnit\FrameworkTestCase` +* Fixed [#2972](https://github.com/sebastianbergmann/phpunit/issues/2972): PHPUnit crashes when test suite contains both `.phpt` files and unconventionally named tests ## [5.7.26] - 2017-12-17 diff --git a/ChangeLog-6.5.md b/ChangeLog-6.5.md index f8ae36fd2ec..6ff08c06bf5 100644 --- a/ChangeLog-6.5.md +++ b/ChangeLog-6.5.md @@ -7,6 +7,8 @@ All notable changes of the PHPUnit 6.5 release series are documented in this fil ### Fixed * Fixed [#2236](https://github.com/sebastianbergmann/phpunit/issues/2236): Exceptions in `tearDown()` do not affect `getStatus()` +* Fixed [#2950](https://github.com/sebastianbergmann/phpunit/issues/2950): Class extending `PHPUnit\Framework\TestSuite` does not extend `PHPUnit\FrameworkTestCase` +* Fixed [#2972](https://github.com/sebastianbergmann/phpunit/issues/2972): PHPUnit crashes when test suite contains both `.phpt` files and unconventionally named tests ## [6.5.5] - 2017-12-17 diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php index ed70f5566ed..21a43596ed4 100644 --- a/src/Framework/TestSuite.php +++ b/src/Framework/TestSuite.php @@ -305,7 +305,7 @@ public function addTestSuite($testClass): void } } - if (!$suiteMethod && !$testClass->isAbstract()) { + if (!$suiteMethod && !$testClass->isAbstract() && $testClass->isSubclassOf(TestCase::class)) { $this->addTest(new self($testClass)); } } else { diff --git a/tests/Regression/GitHub/2972.phpt b/tests/Regression/GitHub/2972.phpt new file mode 100644 index 00000000000..db9e56963dc --- /dev/null +++ b/tests/Regression/GitHub/2972.phpt @@ -0,0 +1,18 @@ +--TEST-- +GH-2972: Test suite shouldn't fail when it contains both *.phpt files and unconventionally named tests +--FILE-- + +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +.. 2 / 2 (100%) + +Time: %s, Memory: %s + +OK (2 tests, 2 assertions) diff --git a/tests/Regression/GitHub/2972/issue-2972-test.phpt b/tests/Regression/GitHub/2972/issue-2972-test.phpt new file mode 100644 index 00000000000..4d09cf5a94e --- /dev/null +++ b/tests/Regression/GitHub/2972/issue-2972-test.phpt @@ -0,0 +1,10 @@ +--TEST-- +Just a sample test for issue 2972, does not actually test anything +--FILE-- + +===DONE=== +--EXPECT-- +Hello world +===DONE=== diff --git a/tests/Regression/GitHub/2972/unconventiallyNamedIssue2972Test.php b/tests/Regression/GitHub/2972/unconventiallyNamedIssue2972Test.php new file mode 100644 index 00000000000..3fd57f018ec --- /dev/null +++ b/tests/Regression/GitHub/2972/unconventiallyNamedIssue2972Test.php @@ -0,0 +1,13 @@ +assertNotEmpty('Hello world!'); + } +}