diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index fb7bf30c84..cc18d51659 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -97,6 +97,15 @@ class SymfonyTestsListenerTrait $suiteName = $suite->getName(); $this->testsWithWarnings = array(); + foreach ($suite->tests() as $test) { + if (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) { + continue; + } + if (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) { + $test->setPreserveGlobalState(false); + } + } + if (-1 === $this->state) { echo "Testing $suiteName\n"; $this->state = 0; @@ -132,10 +141,6 @@ class SymfonyTestsListenerTrait if (in_array('dns-sensitive', $groups, true)) { DnsMock::register($test->getName()); } - } elseif (!($test instanceof \PHPUnit_Framework_TestCase || $test instanceof TestCase)) { - // no-op - } elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) { - $test->setPreserveGlobalState(false); } } } @@ -146,8 +151,6 @@ class SymfonyTestsListenerTrait || isset($this->wasSkipped[$suiteName]['*']) || isset($this->wasSkipped[$suiteName][$test->getName()])) { $skipped[] = $test; - } elseif (null === $Test::getPreserveGlobalStateSettings(get_class($test), $test->getName(false))) { - $test->setPreserveGlobalState(false); } } $suite->setTests($skipped); diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 61c45c102b..562d018124 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -11,7 +11,7 @@ */ // Please update when phpunit needs to be reinstalled with fresh deps: -// Cache-Id-Version: 2017-11-22 09:00 UTC +// Cache-Id-Version: 2017-11-22 09:30 UTC error_reporting(-1);