feat: adds --retry option

This commit is contained in:
Nuno Maduro
2021-12-04 21:18:55 +00:00
parent 8047ae570d
commit 106b279ed0
17 changed files with 237 additions and 113 deletions

View File

@ -101,7 +101,7 @@ final class TestCaseFactory
*
* @param array<int, TestCaseMethodFactory> $methods
*/
public function evaluate(string $filename, array $methods): string
public function evaluate(string $filename, array $methods): void
{
if ('\\' === DIRECTORY_SEPARATOR) {
// In case Windows, strtolower drive name, like in UsesCall.
@ -123,7 +123,7 @@ final class TestCaseFactory
$classFQN = 'P\\' . $relativePath;
if (class_exists($classFQN)) {
return $classFQN;
return;
}
$hasPrintableTestCaseClassFQN = sprintf('\%s', HasPrintableTestCaseName::class);
@ -142,7 +142,7 @@ final class TestCaseFactory
}
$methodsCode = implode('', array_map(
fn (TestCaseMethodFactory $methodFactory) => $methodFactory->buildForEvaluation(self::$annotations),
fn (TestCaseMethodFactory $methodFactory) => $methodFactory->buildForEvaluation($classFQN, self::$annotations),
$methods
));
@ -164,8 +164,6 @@ final class TestCaseFactory
} catch (ParseError $caught) {
throw new RuntimeException(sprintf('Unable to create test case for test file at %s', $filename), 1, $caught);
}
return $classFQN;
}
/**