public function testCommandHasCacheFileOption() { $command = new FixCommand(); $definition = $command->getDefinition(); $this->assertTrue($definition->hasOption('cache-file')); $option = $definition->getOption('cache-file'); $this->assertNull($option->getShortcut()); $this->assertTrue($option->isValueRequired()); $this->assertSame('The path to the cache file', $option->getDescription()); $this->assertNull($option->getDefault()); }
public function testExitCodeActualRunWithChangedAndInvalidFiles() { $errorsManager = new ErrorsManager(); $errorsManager->report(new Error(Error::TYPE_INVALID, 'Invalid.php')); $fixer = $this->getFixerMock(array('Changed.php'), $errorsManager); $command = new FixCommand($fixer); $input = $this->getInputMock(array('dry-run' => false)); $exitCode = $command->run($input, new NullOutput()); $this->assertSame(0, $exitCode); }