diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php index 55b42cd0f90..63eeefae187 100644 --- a/src/Framework/TestSuite.php +++ b/src/Framework/TestSuite.php @@ -352,9 +352,8 @@ public function addWarning(string $warning): void public function addTestFile(string $filename): void { if (\file_exists($filename) && \substr($filename, -5) === '.phpt') { - $this->addTest( - new PhptTestCase($filename) - ); + $this->addTest(new PhptTestCase($filename)); + $this->declaredClasses = \get_declared_classes(); return; @@ -571,7 +570,9 @@ public function run(TestResult $result = null): TestResult echo \implode( \PHP_EOL, \array_unique($this->warnings) - ), \PHP_EOL, \PHP_EOL; + ), + \PHP_EOL, + \PHP_EOL; } /** @psalm-var class-string $className */