make test directory configurable

This commit is contained in:
Brian Faust
2021-05-03 18:28:20 +03:00
parent d2babb1331
commit 567af55a19
11 changed files with 43 additions and 15 deletions

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Pest\Actions;
use Pest\Support\Str;
use function Pest\testDirectory;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\Util\FileLoader;
use RecursiveDirectoryIterator;
@ -33,7 +34,7 @@ final class LoadStructure
*/
public static function in(string $rootPath): void
{
$testsPath = $rootPath . DIRECTORY_SEPARATOR . 'tests';
$testsPath = $rootPath . DIRECTORY_SEPARATOR . testDirectory();
$load = function ($filename): bool {
return file_exists($filename) && (bool) FileLoader::checkAndLoad($filename);