Files
pest/bin/pest
2020-06-05 11:52:23 +02:00

39 lines
1.1 KiB
PHP
Executable File

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