Skip to content

Commit e7032a2

Browse files
committed
Fix tests-levels-matrix
1 parent aadaa38 commit e7032a2

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/workflows/tests-levels-matrix.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
<?php declare(strict_types = 1);
22

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');
44

55
$simpleXml = simplexml_load_file('test-list.xml');
66
if ($simpleXml === false) {
77
throw new RuntimeException('Error loading test-list.xml');
88
}
99

1010
$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'];
1815

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';
2118

22-
$filter = str_replace('\\', '\\\\', $testCaseName);
19+
$filter = str_replace('\\', '\\\\', $testCaseName);
2320

24-
$testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter));
21+
$testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter));
22+
}
2523
}
2624
}
2725

0 commit comments

Comments
 (0)