Ejemplo n.º 1
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(), 'Creates a small CruiseControl example.');
     $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.');
 }
 /**
  * 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(), 'Merges a set of PHPUnit logs into a single new file.');
 }
Ejemplo n.º 3
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(), 'Installs CruiseControl start-up script for linux.');
     $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.');
     $def->addArgument($this->getCommandId(), 'init-dir', 'Init scripts directory.');
 }
Ejemplo n.º 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)
 {
     if (!$def->hasOption($command->getCommandId(), 'pear-executables-dir')) {
         $def->addOption($command->getCommandId(), 'e', 'pear-executables-dir', 'The pear directory with cli scripts.', true);
     }
 }
Ejemplo n.º 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(), 'Generates the metric graphs with ezcGraph');
     $def->addArgument($this->getCommandId(), 'project-log-dir', 'The project log directory.');
     $def->addArgument($this->getCommandId(), 'project-output-dir', 'The graph output directory.', false);
 }
Ejemplo n.º 6
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);
 }
 /**
  * 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);
 }
Ejemplo n.º 8
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);
 }
Ejemplo n.º 9
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'));
 }
Ejemplo n.º 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(), '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);
 }
Ejemplo n.º 13
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', '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);
 }
Ejemplo n.º 14
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);
 }
Ejemplo n.º 15
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.');
 }
Ejemplo n.º 16
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(), 'Installs the CruiseControl patches.');
     $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.');
 }
 /**
  * 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(), 'Removes old build artifacts and logs for a specified project.');
     $def->addArgument($this->getCommandId(), 'cc-install-dir', 'The installation directory of CruiseControl.');
 }
Ejemplo n.º 18
0
 /**
  * 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();
 }