mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Ignore the absence of the tests folder
This commit is contained in:
@ -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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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);
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user