示例#1
0
 /**
  * Callback method that registers a command extension. 
  *
  * @param phpucConsoleInputDefinition $def 
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  * 
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'z', 'without-ezc-graph', 'Disable ezcGraph support.');
 }
 /**
  * Callback method that registers a command extension. 
  *
  * @param phpucConsoleInputDefinition $def 
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  * 
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'i', 'input', 'List of input log files(separated by comma) or a single log ' . 'directory with multiple log files.', true, null, true);
     $def->addOption($command->getCommandId(), 'o', 'output', 'Optional file name for the generated phpunit log. The default ' . 'file name is "phpunit.xml".', true, null, true);
     $def->addOption($command->getCommandId(), 'b', 'builds', 'Optional list of build identifiers(separated by comma). This ' . 'option can be used together with a comma separated list of log ' . 'files', true);
 }
示例#3
0
 /**
  * Callback method that registers a command extension. 
  *
  * @param phpucConsoleInputDefinition $def 
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  * 
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     if (!$def->hasOption($command->getCommandId(), 'pear-executables-dir')) {
         $def->addOption($command->getCommandId(), 'e', 'pear-executables-dir', 'The pear directory with cli scripts.', true);
     }
 }
示例#4
0
 /**
  * Callback method that registers a command extension.
  *
  * @param phpucConsoleInputDefinition $def
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  *
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'u', 'cc-user', 'Username to run Cruisecontrol service.', true, 'cruisecontrol', true);
     $def->addOption($command->getCommandId(), 'j', 'java-home', 'The full path to JAVA_HOME directory.', true, '/usr', true);
     $def->addOption($command->getCommandId(), 'b', 'cc-bin', 'Cruisecontrol script name.', true, 'cruisecontrol.sh', true);
 }
示例#5
0
 /**
  * Callback method that registers a cli command.
  *
  * @param phpucConsoleInputDefinition $def The input definition container.
  * 
  * @return void
  */
 public function registerCommand(phpucConsoleInputDefinition $def)
 {
     $def->addCommand($this->getCommandId(), 'Deletes a CruiseControl project with all logs and artifacts.');
     $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.');
     $def->addOption($this->getCommandId(), 'j', 'project-name', 'The name of the project to be deleted.', true, null, true);
 }
 /**
  * Tests that {@link phpucConsoleInputDefinition::addOption()} adds an option
  * to the internal data structure.
  *
  * @return void
  */
 public function testAddOption()
 {
     $definition = new phpucConsoleInputDefinition();
     $definition->addCommand('manuel', 'Hello World.');
     $this->assertFalse($definition->hasOption('manuel', 'p1'));
     $this->assertFalse($definition->hasOption('manuel', 'pichler1'));
     $definition->addOption('manuel', 'p1', 'pichler1', 'Hello World.', null, null, false, phpucConsoleInputDefinition::MODE_HIDDEN);
     $this->assertTrue($definition->hasOption('manuel', 'p1'));
     $this->assertTrue($definition->hasOption('manuel', 'pichler1'));
 }
示例#7
0
 /**
  * Callback method that registers a command extension.
  *
  * @param phpucConsoleInputDefinition $def
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  *
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'li', 'without-lint', 'Disable lint check.');
 }
 /**
  * Callback method that registers a command extension.
  *
  * @param phpucConsoleInputDefinition $def
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  *
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'j', 'project-name', 'The name of the generated project.', true, null, true);
     $def->addOption($command->getCommandId(), 'k', 'keep-builds', 'The number of builds to keep.', true, 20, true);
     $def->addOption($command->getCommandId(), 'd', 'keep-days', 'Removes all builds older than specified days.', true);
 }
 /**
  * Callback method that registers a command extension.
  *
  * @param phpucConsoleInputDefinition $def
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  *
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'u', 'force-update', 'Force graphic creation and overwrite existing files.');
     $def->addOption($command->getCommandId(), 'm', 'max-number', 'Maximum number of entries that will appear in the generated graph.', true);
 }
示例#10
0
 /**
  * Callback method that registers a command extension. 
  *
  * @param phpucConsoleInputDefinition $def 
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  * 
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'A', 'ant-script', 'The full path to a custom ant launcher script.', true);
     $def->addOption($command->getCommandId(), 'j', 'project-name', 'The name of the generated project.', true, 'php-under-control', true);
     $def->addOption($command->getCommandId(), 'i', 'schedule-interval', 'Schedule interval.', true, 300, true);
 }
示例#11
0
 /**
  * Callback method that registers a command extension.
  *
  * @param phpucConsoleInputDefinition $def
  *        The input definition container.
  * @param phpucConsoleCommandI  $command
  *        The context cli command instance.
  *
  * @return void
  */
 public function registerCommandExtension(phpucConsoleInputDefinition $def, phpucConsoleCommandI $command)
 {
     $def->addOption($command->getCommandId(), 'v', 'version-control', 'The used version control system.', array('svn', 'cvs', 'git'), null, true);
     $def->addOption($command->getCommandId(), 'x', 'version-control-url', 'The version control system project url.', true, null, true);
     $def->addOption($command->getCommandId(), 'u', 'username', 'Optional username for the version control system.', true);
     $def->addOption($command->getCommandId(), 'p', 'password', 'Optional password for the version control system.', true);
     $def->addOption($command->getCommandId(), 'd', 'destination', 'This option is deprecated and will be removed in upcoming versions.', true, 'source', true);
     $def->addOption($command->getCommandId(), 'm', 'module', 'A CVS project module.', true);
 }
 /**
  * Tests that {@link phpucConsoleInput::parse()} fails with an exception if
  * an option value doesn't match against the defined regexp.
  *
  * @return void
  */
 public function testConsoleInputWithInvalidFormatedOptionValueFail()
 {
     $definition = new phpucConsoleInputDefinition();
     $definition->addCommand('foo', 'The foo command.');
     $definition->addOption('foo', 'b', 'bar', 'The bar option', '/^[0-9a-f]{4}\\-[0-9a-f]{2}$/D', null, true);
     $this->prepareArgv(array('foo', '--bar', '071a-0'));
     $this->setExpectedException('phpucConsoleException', "The value for option '--bar' has an invalid format.");
     $input = new phpucConsoleInput($definition);
     $input->parse();
 }