Skip to content

Commit 9d55c11

Browse files
committed
ACQE-5171: Implement a script to update Integration or WebAPI phpunit.xml file to support tests under vendor directory
1 parent 63a4888 commit 9d55c11

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dev/tests/utils/update-test-paths.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function getTestType(DOMDocument $dom): string
5050
$testType = 'SOAP';
5151
}
5252
if (stripos($testsuite->getAttribute('name'), 'graphql') !== false) {
53-
$testType = 'GraphQL';
53+
$testType = 'GraphQl';
5454
}
5555
if (stripos($testsuite->getAttribute('name'), 'integration') !== false) {
5656
$testType = 'Integration';
@@ -74,7 +74,7 @@ function findMagentoModuleDirs(string $testType): array
7474
'Integration' => 'Integration',
7575
'REST' => 'Api',
7676
'SOAP' => 'Api',
77-
'GraphQL' => 'GraphQl'
77+
'GraphQl' => 'GraphQl'
7878
];
7979
$magentoBaseDir = realpath(__DIR__ . '/../../..') . DIRECTORY_SEPARATOR;
8080
$magentoBaseDirPattern = preg_quote($magentoBaseDir, '/');
@@ -85,6 +85,10 @@ function findMagentoModuleDirs(string $testType): array
8585
preg_match('~' . $magentoBaseDirPattern . '(.+)\/[^\/]+~', $modulePath, $match);
8686
if (isset($match[1]) && isset($patterns[$testType])) {
8787
$testPathPatterns[] = '../../../' . $match[1] . '/*/Test/' . $patterns[$testType];
88+
if ($testType == 'GraphQl') {
89+
$testPathPatterns[] = '../../../' . $match[1] . '/*GraphQl/Test/Api';
90+
$testPathPatterns[] = '../../../' . $match[1] . '/*graph-ql/Test/Api';
91+
}
8892
}
8993
}
9094

@@ -205,7 +209,7 @@ function getDefaultSuites(string $testType): array
205209
]
206210
];
207211
break;
208-
case 'GraphQL':
212+
case 'GraphQl':
209213
$suites = [
210214
'directory' => [
211215
'testsuite/Magento/GraphQl'

0 commit comments

Comments
 (0)