Skip to content

Commit a902187

Browse files
committed
Test phpunit config
1 parent 4bcbeac commit a902187

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Diff for: phpunit.xml.dist

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
<testsuite name="Symfony Polyfill Test Suite">
1515
<directory>./tests/</directory>
1616
</testsuite>
17+
<testsuite name="Symfony Intl Test Suite">
18+
<directory>./tests/Intl/</directory>
19+
</testsuite>
1720
</testsuites>
1821

1922
<filter>

Diff for: src/Util/TestListenerTrait.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public function startTestSuite($mainSuite)
2525
}
2626
self::$enabledPolyfills = false;
2727
$SkippedTestError = class_exists('PHPUnit\Framework\SkippedTestError') ? 'PHPUnit\Framework\SkippedTestError' : 'PHPUnit_Framework_SkippedTestError';
28-
$warnings = array();
2928

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

4646
foreach (new \RegexIterator($bootstrap, '/define\(\'/') as $defLine) {
@@ -109,8 +109,10 @@ function {$f['name']}{$f['signature']}
109109
$mainSuite->addTest(new TestListener($suite));
110110
}
111111
}
112-
foreach ($warnings as $w) {
113-
$mainSuite->addTest($w);
112+
if (isset($warnings)) {
113+
foreach ($warnings as $w) {
114+
$mainSuite->addTest($w);
115+
}
114116
}
115117
}
116118

0 commit comments

Comments
 (0)