#!/usr/bin/env php register(); // get $rootPath based on $autoloadPath $rootPath = dirname($autoloadPath, 2); $argv = new ArgvInput(); $testSuite = TestSuite::getInstance($rootPath, $argv->getParameterOption('--test-directory', 'tests')); $isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never'; $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated); $container = Container::getInstance(); $container->add(TestSuite::class, $testSuite); $container->add(OutputInterface::class, $output); ValidatesEnvironment::in($testSuite); // lets remove any arguments that PHPUnit does not understand if ($argv->hasParameterOption('--test-directory')) { foreach ($_SERVER['argv'] as $key => $value) { if (strpos($value, '--test-directory') !== false) { unset($_SERVER['argv'][$key]); } } } exit($container->get(Command::class)->run($_SERVER['argv'])); })();