Uses Collision ^7.0

This commit is contained in:
Nuno Maduro
2022-09-15 01:07:15 +01:00
parent eab944023c
commit 3ff95faaaa
47 changed files with 646 additions and 308 deletions

View File

@ -19,6 +19,20 @@ trait HandleArguments
return in_array($argument, $arguments, true);
}
/**
* Adds the given argument and value to the list of arguments.
*
* @param array<int, string> $arguments
*
* @return array<int, string>
*/
public function pushArgument(string $argument, array $arguments): array
{
$arguments[] = $argument;
return $arguments;
}
/**
* Pops the given argument from the arguments.
*

View File

@ -14,7 +14,7 @@ final class Environment implements HandlesArguments
/**
* The continuous integration environment.
*/
public const CI = 'ci';
public const CI = 'ci';
/**
* The local environment.

27
src/Plugins/Printer.php Normal file
View File

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Pest\Plugins;
use Pest\Contracts\Plugins\HandlesArguments;
/**
* @internal
*/
final class Printer implements HandlesArguments
{
use Concerns\HandleArguments;
/**
* {@inheritDoc}
*/
public function handleArguments(array $arguments): array
{
if (! array_key_exists('COLLISION_PRINTER', $_SERVER)) {
return $arguments;
}
return $this->pushArgument('--no-output', $arguments);
}
}