/** * This test checks whether --without-php-documentor option has been set properly * * @covers phpucPhpDocumentorTask::registerCommandExtension * * @return void */ public function testPhpDocumentorTaskIsIgnored() { $this->prepareArgv(array('example', PHPUC_TEST_DIR, '--without-php-documentor')); $input = new phpucConsoleInput(); $input->parse(); $command = phpucAbstractCommand::createCommand($input->args->command); $command->setConsoleArgs($input->args); $cmdTasks = $command->createTasks(); $this->assertPhpucTaskNotOnTheList($cmdTasks, 'phpucPhpDocumentorTask'); }
/** * Performs a single cli request. * * @return void */ public function run() { try { if ($this->input->parse()) { phpucConsoleOutput::set(new phpucConsoleOutput()); $command = phpucAbstractCommand::createCommand($this->input->args->command); $command->setConsoleArgs($this->input->args); $command->validate(); $command->execute(); } exit(0); } catch (phpucConsoleException $e) { echo $e->getMessage(), PHP_EOL; exit(1); } catch (phpucExecuteException $e) { echo $e->getMessage(), PHP_EOL; exit(2); } catch (phpucValidateException $e) { echo $e->getMessage(), PHP_EOL; exit(3); } catch (phpucRuntimeException $e) { echo $e->getMessage(), PHP_EOL; exit(5); } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; exit(4); } }
/** * Tests that the {@link phpucAbstractCommand#createCommand()} fails with an * exception if an invalid command identifier is given. * * @return void */ public function testStaticCreateCommandWithInvalidCommandIdFail() { $commandId = 'foobar'; $commandIds = $this->globCommandIdsAndClassNames(); if (isset($commandIds[$commandId])) { $this->markTestSkipped("Unexpected command id '{$commandId}' exists."); } $this->setExpectedException('phpucErrorException', 'Unknown command "foobar" used.'); phpucAbstractCommand::createCommand($commandId); }