ParaTest\Console\Testers\PHPUnit::configure PHP Method

configure() public method

Configures the ParaTestCommand with PHPUnit specific definitions
public configure ( Command $command ) : mixed
$command Symfony\Component\Console\Command\Command
return mixed
    public function configure(Command $command)
    {
        $command->addOption('phpunit', null, InputOption::VALUE_REQUIRED, 'The PHPUnit binary to execute. <comment>(default: vendor/bin/phpunit)</comment>')->addOption('runner', null, InputOption::VALUE_REQUIRED, 'Runner or WrapperRunner. <comment>(default: Runner)</comment>')->addOption('bootstrap', null, InputOption::VALUE_REQUIRED, 'The bootstrap file to be used by PHPUnit.')->addOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'The PHPUnit configuration file to use.')->addOption('group', 'g', InputOption::VALUE_REQUIRED, 'Only runs tests from the specified group(s).')->addOption('exclude-group', null, InputOption::VALUE_REQUIRED, 'Don\'t run tests from the specified group(s).')->addOption('stop-on-failure', null, InputOption::VALUE_NONE, 'Don\'t start any more processes after a failure.')->addOption('log-junit', null, InputOption::VALUE_REQUIRED, 'Log test execution in JUnit XML format to file.')->addOption('colors', null, InputOption::VALUE_NONE, 'Displays a colored bar as a test result.')->addOption('testsuite', null, InputOption::VALUE_OPTIONAL, 'Filter which testsuite to run')->addArgument('path', InputArgument::OPTIONAL, 'The path to a directory or file containing tests. <comment>(default: current directory)</comment>')->addOption('path', null, InputOption::VALUE_REQUIRED, 'An alias for the path argument.');
        $this->command = $command;
    }

Usage Example

Exemplo n.º 1
0
 public function testConfigureAddsOptionsAndArgumentsToCommand()
 {
     $testCommand = new TestCommand();
     $definition = new InputDefinition(array(new InputOption('phpunit', null, InputOption::VALUE_REQUIRED, 'The PHPUnit binary to execute. <comment>(default: vendor/bin/phpunit)</comment>'), new InputOption('runner', null, InputOption::VALUE_REQUIRED, 'Runner or WrapperRunner. <comment>(default: Runner)</comment>'), new InputOption('bootstrap', null, InputOption::VALUE_REQUIRED, 'The bootstrap file to be used by PHPUnit.'), new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'The PHPUnit configuration file to use.'), new InputOption('group', 'g', InputOption::VALUE_REQUIRED, 'Only runs tests from the specified group(s).'), new InputOption('stop-on-failure', null, InputOption::VALUE_NONE, 'Don\'t start any more processes after a failure.'), new InputOption('exclude-group', null, InputOption::VALUE_REQUIRED, 'Don\'t run tests from the specified group(s).'), new InputOption('log-junit', null, InputOption::VALUE_REQUIRED, 'Log test execution in JUnit XML format to file.'), new InputOption('colors', null, InputOption::VALUE_NONE, 'Displays a colored bar as a test result.'), new InputArgument('path', InputArgument::OPTIONAL, 'The path to a directory or file containing tests. <comment>(default: current directory)</comment>'), new InputOption('path', null, InputOption::VALUE_REQUIRED, 'An alias for the path argument.'), new InputOption('testsuite', null, InputOption::VALUE_OPTIONAL, 'Filter which testsuite to run')));
     $tester = new PHPUnit();
     $tester->configure($testCommand);
     $this->assertEquals($definition, $testCommand->getDefinition());
 }