File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed
src/Magento/FunctionalTestingFramework/Console Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -81,24 +81,23 @@ protected function getTestAndSuiteConfiguration(array $tests)
81
81
$ testConfiguration ['tests ' ] = null ;
82
82
$ testConfiguration ['suites ' ] = null ;
83
83
$ testsReferencedInSuites = SuiteObjectHandler::getInstance ()->getAllTestReferences ();
84
- $ resolvedTests = [];
84
+ $ suiteToTestPair = [];
85
85
86
86
foreach ($ tests as $ test ) {
87
87
if (array_key_exists ($ test , $ testsReferencedInSuites )) {
88
88
$ suites = $ testsReferencedInSuites [$ test ];
89
- $ resolvedTests = array_merge (
90
- $ resolvedTests ,
91
- array_map (function ($ value ) use ($ test ) {
92
- return $ value . ': ' . $ test ;
93
- }, $ suites )
94
- );
89
+ foreach ($ suites as $ suite ) {
90
+ $ suiteToTestPair [] = "$ suite: $ test " ;
91
+ }
95
92
}
96
93
// configuration for tests
97
- else $ testConfiguration ['tests ' ][] = $ test ;
94
+ else {
95
+ $ testConfiguration ['tests ' ][] = $ test ;
96
+ }
98
97
}
99
98
// configuration for suites
100
- foreach ($ resolvedTests as $ test ) {
101
- list ($ suite , $ test ) = explode (": " , $ test );
99
+ foreach ($ suiteToTestPair as $ pair ) {
100
+ list ($ suite , $ test ) = explode (": " , $ pair );
102
101
$ testConfiguration ['suites ' ][$ suite ][] = $ test ;
103
102
}
104
103
$ testConfigurationJson = json_encode ($ testConfiguration );
Original file line number Diff line number Diff line change @@ -112,7 +112,8 @@ function ($type, $buffer) use ($output) {
112
112
return $ returnCode ;
113
113
}
114
114
115
- /** Get an array of tests with resolved suite references from $testConfiguration
115
+ /**
116
+ * Get an array of tests with resolved suite references from $testConfiguration
116
117
* eg: if test is referenced in a suite, it'll be stored in format suite:test
117
118
* @param string $testConfigurationJson
118
119
* @return array
@@ -125,12 +126,9 @@ private function resolveSuiteReferences($testConfigurationJson)
125
126
$ testArrayBuilder = [];
126
127
127
128
foreach ($ suitesArray as $ suite => $ tests ) {
128
- $ testArrayBuilder = array_merge (
129
- $ testArrayBuilder ,
130
- array_map (function ($ test ) use ($ suite ) {
131
- return $ suite . ': ' . $ test ;
132
- }, $ tests )
133
- );
129
+ foreach ($ tests as $ test ){
130
+ $ testArrayBuilder [] = "$ suite: $ test " ;
131
+ }
134
132
}
135
133
return array_merge ($ testArrayBuilder , $ testsArray );
136
134
}
You can’t perform that action at this time.
0 commit comments