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

30
src/Plugins/Retry.php Normal file
View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
/**
* @internal
*/
final class Retry implements HandlesArguments
{
use Concerns\HandleArguments;
/**
* Whether it should show retry or not.
*/
public static bool $retrying = false;
/**
* {@inheritDoc}
*/
public function handleArguments(array $arguments): array
{
self::$retrying = $this->hasArgument('--retry', $arguments);
return $this->popArgument('--retry', $arguments);
}
}