Skip to content

Commit

Permalink
Test phpunit config
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Feb 17, 2019
1 parent 4bcbeac commit a902187
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<testsuite name="Symfony Polyfill Test Suite">
<directory>./tests/</directory>
</testsuite>
<testsuite name="Symfony Intl Test Suite">
<directory>./tests/Intl/</directory>
</testsuite>
</testsuites>

<filter>
Expand Down
8 changes: 5 additions & 3 deletions src/Util/TestListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public function startTestSuite($mainSuite)
}
self::$enabledPolyfills = false;
$SkippedTestError = class_exists('PHPUnit\Framework\SkippedTestError') ? 'PHPUnit\Framework\SkippedTestError' : 'PHPUnit_Framework_SkippedTestError';
$warnings = array();

foreach ($mainSuite->tests() as $suite) {
$testClass = $suite->getName();
Expand All @@ -41,6 +40,7 @@ public function startTestSuite($mainSuite)
}
$testedClass = new \ReflectionClass($m[1].$m[2]);
$bootstrap = new \SplFileObject(\dirname($testedClass->getFileName()).'/bootstrap.php');
$warnings = array();
$defLine = null;

foreach (new \RegexIterator($bootstrap, '/define\(\'/') as $defLine) {
Expand Down Expand Up @@ -109,8 +109,10 @@ function {$f['name']}{$f['signature']}
$mainSuite->addTest(new TestListener($suite));
}
}
foreach ($warnings as $w) {
$mainSuite->addTest($w);
if (isset($warnings)) {
foreach ($warnings as $w) {
$mainSuite->addTest($w);
}
}
}

Expand Down

0 comments on commit a902187

Please sign in to comment.