26
26
$ testType = getTestType ($ xmlDom );
27
27
// Update testsuite based on magento installation
28
28
$ xmlDom = updateTestSuite ($ xmlDom , $ testType );
29
- //$xmlDom->save($argv[1]); //Uncomment after review
30
- $ xmlDom ->save ($ argv [1 ] . '.new ' );
29
+ $ xmlDom ->save ($ argv [1 ]);
31
30
echo "{$ testType } " . basename ($ argv [1 ]) . " is updated. " ;
32
31
33
32
/**
@@ -40,7 +39,6 @@ function getTestType(DOMDocument $dom): string
40
39
{
41
40
$ testType = null ;
42
41
/** @var DOMElement $testsuite */
43
- //$testsuite = null;
44
42
foreach ($ dom ->getElementsByTagName ('testsuite ' ) as $ testsuite ) {
45
43
if (stripos ($ testsuite ->getAttribute ('name ' ), 'real suite ' ) === false ) {
46
44
continue ;
@@ -76,7 +74,7 @@ function findMagentoModuleDirs(string $testType): array
76
74
'Integration ' => 'Integration ' ,
77
75
'REST ' => 'Api ' ,
78
76
'SOAP ' => 'Api ' ,
79
- // Is there a path pattern for 'GraphQL'?
77
+ ' GraphQL ' => ' GraphQl '
80
78
];
81
79
$ magentoBaseDir = realpath (__DIR__ . '/../../.. ' ) . DIRECTORY_SEPARATOR ;
82
80
$ magentoBaseDirPattern = preg_quote ($ magentoBaseDir , '/ ' );
@@ -140,7 +138,7 @@ function updateTestSuite(DOMDocument $dom, string $testType): DOMDocument
140
138
// Locate the old node
141
139
$ xpath = new DOMXpath ($ dom );
142
140
$ nodelist = $ xpath ->query ('/phpunit/testsuites/testsuite ' );
143
- for ( $ index = 0 ; $ index < $ nodelist ->count (); $ index ++) {
141
+ for ($ index = 0 ; $ index < $ nodelist ->count (); $ index ++) {
144
142
$ oldNode = $ nodelist ->item ($ index );
145
143
if (stripos ($ oldNode ->getAttribute ('name ' ), 'real suite ' ) !== false ) {
146
144
// Load the $parent document fragment into the current document
0 commit comments