@@ -109,10 +109,10 @@ function ($type, $buffer) use ($output) {
109
109
/**
110
110
* Returns a list of tests/suites which should have an additional run.
111
111
*
112
- * @param string $failedTests
112
+ * @param array $failedTests
113
113
* @return array
114
114
*/
115
- private function filterTestsForExecution (string $ failedTests ): array
115
+ private function filterTestsForExecution (array $ failedTests ): array
116
116
{
117
117
$ testsOrGroupsToRerun = [];
118
118
@@ -126,7 +126,10 @@ private function filterTestsForExecution(string $failedTests): array
126
126
if ($ suiteName === self ::DEFAULT_TEST_GROUP ) {
127
127
$ testsOrGroupsToRerun [] = $ testPath ;
128
128
} else {
129
- $ testsOrGroupsToRerun [] = "-g " . $ suiteName ;
129
+ $ group = "-g " . $ suiteName ;
130
+ if (!in_array ($ group , $ testsOrGroupsToRerun )) {
131
+ $ testsOrGroupsToRerun [] = $ group ;
132
+ }
130
133
}
131
134
}
132
135
}
@@ -138,11 +141,16 @@ private function filterTestsForExecution(string $failedTests): array
138
141
* Returns an array of tests read from the failed test file in _output
139
142
*
140
143
* @param string $filePath
141
- * @return array|boolean
144
+ * @return array
142
145
*/
143
- private function readFailedTestFile ($ filePath )
146
+ private function readFailedTestFile (string $ filePath ): array
144
147
{
145
- return file ($ filePath , FILE_IGNORE_NEW_LINES );
148
+ $ data = [];
149
+ if (file_exists ($ filePath )) {
150
+ $ file = file ($ filePath , FILE_IGNORE_NEW_LINES );
151
+ $ data = $ file === false ? [] : $ file ;
152
+ }
153
+ return $ data ;
146
154
}
147
155
148
156
/**
0 commit comments