Files
pest/bin/pest
2020-06-05 16:21:35 +02:00

33 lines
885 B
PHP
Executable File

#!/usr/bin/env php
<?php declare(strict_types=1);
use NunoMaduro\Collision\Provider;
use Pest\Actions\ValidatesEnvironment;
use Pest\Console\Command;
use Pest\TestSuite;
use Symfony\Component\Console\Output\ConsoleOutput;
(static function () {
// Used when Pest is required using composer.
$vendorPath = dirname(__DIR__, 4) . '/vendor/autoload.php';
// Used when Pest maintainers are running Pest tests.
$localPath = dirname(__DIR__) . '/vendor/autoload.php';
if (file_exists($vendorPath)) {
include_once $vendorPath;
} else {
include_once $localPath;
}
(new Provider())->register();
$rootPath = getcwd();
$testSuite = TestSuite::getInstance($rootPath);
ValidatesEnvironment::in($testSuite);
exit((new Command($testSuite, new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, true)))->run($_SERVER['argv']));
})();