|
1 | 1 | <?php declare(strict_types = 1);
|
2 | 2 |
|
3 |
| -shell_exec('php vendor/bin/phpunit --list-tests-xml test-list.xml'); |
| 3 | +shell_exec('php vendor/bin/phpunit --group levels --list-tests-xml test-list.xml'); |
4 | 4 |
|
5 | 5 | $simpleXml = simplexml_load_file('test-list.xml');
|
6 | 6 | if ($simpleXml === false) {
|
7 | 7 | throw new RuntimeException('Error loading test-list.xml');
|
8 | 8 | }
|
9 | 9 |
|
10 | 10 | $testFilters = [];
|
11 |
| -foreach($simpleXml->testCaseClass as $testCaseClass) { |
12 |
| - foreach($testCaseClass->testCaseMethod as $testCaseMethod) { |
13 |
| - if ((string) $testCaseMethod['groups'] !== 'levels') { |
14 |
| - continue; |
15 |
| - } |
16 |
| - |
17 |
| - $testCaseName = (string) $testCaseMethod['id']; |
| 11 | +foreach($simpleXml->tests as $testClasses) { |
| 12 | + foreach($testClasses->testClass as $testClass) { |
| 13 | + foreach($testClass->testMethod as $testMethod) { |
| 14 | + $testCaseName = (string)$testMethod['id']; |
18 | 15 |
|
19 |
| - [$className, $testName] = explode('::', $testCaseName, 2); |
20 |
| - $fileName = 'tests/'. str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php'; |
| 16 | + [$className, $testName] = explode('::', $testCaseName, 2); |
| 17 | + $fileName = 'tests/' . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php'; |
21 | 18 |
|
22 |
| - $filter = str_replace('\\', '\\\\', $testCaseName); |
| 19 | + $filter = str_replace('\\', '\\\\', $testCaseName); |
23 | 20 |
|
24 |
| - $testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter)); |
| 21 | + $testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter)); |
| 22 | + } |
25 | 23 | }
|
26 | 24 | }
|
27 | 25 |
|
|
0 commit comments