1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72:
<?php
namespace Peridot\Console;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition as Definition;
use Symfony\Component\Console\Input\InputOption;
class InputDefinition extends Definition
{
public function __construct()
{
parent::__construct([]);
$this->addArgument(new InputArgument('path', InputArgument::OPTIONAL, 'The path to a directory or file containing specs'));
$this->addOption(new InputOption('focus', 'f', InputOption::VALUE_REQUIRED, 'Run tests matching <pattern>'));
$this->addOption(new InputOption('skip', 's', InputOption::VALUE_REQUIRED, 'Skip tests matching <pattern>'));
$this->addOption(new InputOption('grep', 'g', InputOption::VALUE_REQUIRED, 'Run tests with filenames matching <pattern> <comment>(default: *.spec.php)</comment>'));
$this->addOption(new InputOption('no-colors', 'C', InputOption::VALUE_NONE, 'Disable output colors'));
$this->addOption(new InputOption('--force-colors', null, InputOption::VALUE_NONE, 'Force output colors'));
$this->addOption(new InputOption('reporter', 'r', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Select which reporter(s) to use', ['spec']));
$this->addOption(new InputOption('bail', 'b', InputOption::VALUE_NONE, 'Stop on failure'));
$this->addOption(new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'A php file containing peridot configuration'));
$this->addOption(new InputOption('reporters', null, InputOption::VALUE_NONE, 'List all available reporters'));
$this->addOption(new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display the Peridot version number'));
$this->addOption(new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'));
}
public function argument($name, $mode = null, $description = '', $default = null)
{
$argument = new InputArgument($name, $mode, $description, $default);
$this->addArgument($argument);
return $this;
}
public function option($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
$option = new InputOption($name, $shortcut, $mode, $description, $default);
$this->addOption($option);
return $this;
}
}