Merge pull request #288 from gregorip02/master

Ignore the absence of the tests folder
This commit is contained in:
Nuno Maduro
2021-05-11 08:19:14 +01:00
committed by GitHub
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

@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Pest\PendingObjects; namespace Pest\PendingObjects;
use Closure; use Closure;
use Pest\Exceptions\InvalidUsesPath;
use Pest\TestSuite; use Pest\TestSuite;
/** /**
@ -92,14 +91,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); }, []);
} }
/** /**