mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 10:17:23 +01:00
chore: different refactors
This commit is contained in:
17
bin/pest
17
bin/pest
@ -17,6 +17,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
$_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter';
|
||||
|
||||
$args = $_SERVER['argv'];
|
||||
|
||||
$dirty = false;
|
||||
$todo = false;
|
||||
|
||||
@ -68,11 +69,11 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
// Get $rootPath based on $autoloadPath
|
||||
$rootPath = dirname($autoloadPath, 2);
|
||||
$argv = new ArgvInput();
|
||||
$input = new ArgvInput();
|
||||
|
||||
$testSuite = TestSuite::getInstance(
|
||||
$rootPath,
|
||||
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
||||
$input->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
||||
);
|
||||
|
||||
if ($dirty) {
|
||||
@ -83,19 +84,13 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
$testSuite->tests->addTestCaseMethodFilter(new TodoTestCaseFilter());
|
||||
}
|
||||
|
||||
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
|
||||
$isDecorated = $input->getParameterOption('--colors', 'always') !== 'never';
|
||||
|
||||
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
|
||||
|
||||
$container = Container::getInstance();
|
||||
$container->add(TestSuite::class, $testSuite);
|
||||
$container->add(OutputInterface::class, $output);
|
||||
$container->add(InputInterface::class, $argv);
|
||||
$container->add(Container::class, $container);
|
||||
$kernel = Kernel::boot($testSuite, $input, $output);
|
||||
|
||||
$kernel = Kernel::boot();
|
||||
|
||||
$result = $kernel->handle($output, $args);
|
||||
$result = $kernel->handle($args);
|
||||
|
||||
$kernel->shutdown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user