@@ -80,20 +80,26 @@ protected function getTestAndSuiteConfiguration(array $tests)
80
80
{
81
81
$ testConfiguration ['tests ' ] = [];
82
82
$ testConfiguration ['suites ' ] = [];
83
- $ allSuiteTests = SuiteObjectHandler::getInstance ()->getAllTestReferences ();
84
- $ suiteGroup = [];
83
+ $ testsReferencedInSuites = SuiteObjectHandler::getInstance ()->getAllTestReferences ();
84
+ $ resolvedTests = [];
85
85
86
86
foreach ($ tests as $ test ) {
87
- if (array_key_exists ($ test , $ allSuiteTests )) {
88
- $ suiteGroup [$ test ] = $ allSuiteTests [$ test ];
87
+ if (array_key_exists ($ test , $ testsReferencedInSuites )) {
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
95
}
96
+ // configuration for tests
90
97
else $ testConfiguration ['tests ' ][] = $ test ;
91
98
}
92
-
93
- foreach ($ suiteGroup as $ test => $ suites ) {
94
- foreach ($ suites as $ suite ) {
95
- $ testConfiguration ['suites ' ][$ suite ][] = $ test ;
96
- }
99
+ // configuration for suites
100
+ foreach ($ resolvedTests as $ test ) {
101
+ list ($ suite , $ test ) = explode (": " , $ test );
102
+ $ testConfiguration ['suites ' ][$ suite ][] = $ test ;
97
103
}
98
104
return $ testConfiguration ;
99
105
}
0 commit comments