chore: different refactors

This commit is contained in:
Nuno Maduro
2023-02-11 16:07:30 +00:00
parent e1406554fc
commit 8eaf4859ff
19 changed files with 207 additions and 165 deletions

View File

@ -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();