refacto: --retry option

This commit is contained in:
Nuno Maduro
2023-02-11 16:48:06 +00:00
parent a8f0b96338
commit d69f61c8d3
18 changed files with 61 additions and 200 deletions

37
src/Plugins/Cache.php Normal file
View File

@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
use Pest\Plugins\Concerns\HandleArguments;
/**
* @internal
*/
final class Cache implements HandlesArguments
{
use HandleArguments;
private const TEMPORARY_FOLDER = __DIR__
.DIRECTORY_SEPARATOR
.'..'
.DIRECTORY_SEPARATOR
.'..'
.DIRECTORY_SEPARATOR
.'.temp';
/**
* {@inheritdoc}
*/
public function handleArguments(array $arguments): array
{
$arguments = $this->pushArgument(
sprintf('--cache-directory=%s', realpath(self::TEMPORARY_FOLDER)),
$arguments
);
return $this->pushArgument('--cache-result', $arguments);
}
}