Ignore the absence of the tests folder

This commit is contained in:
Gregori Piñeres
2021-04-10 11:51:13 -04:00
parent 6616b6299b
commit d048d60d04
2 changed files with 5 additions and 31 deletions

View File

@ -1,24 +0,0 @@
<?php
declare(strict_types=1);
namespace Pest\Exceptions;
use InvalidArgumentException;
use NunoMaduro\Collision\Contracts\RenderlessEditor;
use NunoMaduro\Collision\Contracts\RenderlessTrace;
use Symfony\Component\Console\Exception\ExceptionInterface;
/**
* @internal
*/
final class InvalidUsesPath extends InvalidArgumentException implements ExceptionInterface, RenderlessEditor, RenderlessTrace
{
/**
* Creates a new instance of invalid uses path.
*/
public function __construct(string $target)
{
parent::__construct(sprintf('The path `%s` is not valid.', $target));
}
}

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Pest\PendingObjects; namespace Pest\PendingObjects;
use Pest\Exceptions\InvalidUsesPath;
use Pest\TestSuite; use Pest\TestSuite;
/** /**
@ -77,14 +76,13 @@ final class UsesCall
]); ]);
}, $targets); }, $targets);
$this->targets = array_map(function ($target): string { $this->targets = array_reduce($targets, function (array $accumulator, string $target): array {
$isValid = is_dir($target) || file_exists($target); if (is_dir($target) || file_exists($target)) {
if (!$isValid) { $accumulator[] = (string) realpath($target);
throw new InvalidUsesPath($target);
} }
return (string) realpath($target); return $accumulator;
}, $targets); }, []);
} }
/** /**