コード例 #1
0
 public function populate(Parser $parser, InputInterface $input, ConfigurationHelper $configurationHelper, Collection $files)
 {
     $parser->setForced($input->getOption('force'));
     $parser->setEncoding($configurationHelper->getOption($input, 'encoding', 'parser/encoding'));
     $parser->setMarkers($configurationHelper->getOption($input, 'markers', 'parser/markers', array('TODO', 'FIXME'), true));
     $parser->setIgnoredTags($input->getOption('ignore-tags'));
     $parser->setValidate($input->getOption('validate'));
     $parser->setDefaultPackageName($configurationHelper->getOption($input, 'defaultpackagename', 'parser/default-package-name'));
     $parser->setPath($files->getProjectRoot());
 }
コード例 #2
0
 /**
  * @covers phpDocumentor\Command\Helper\ConfigurationHelper::getOption
  * @covers phpDocumentor\Command\Helper\ConfigurationHelper::valueIsEmpty
  * @covers phpDocumentor\Command\Helper\ConfigurationHelper::getConfigValueFromPath
  */
 public function testIfValueIsNotRetrievedFromConfigIfItIsInInput()
 {
     // Arrange
     $optionName = 'myOption';
     $expected = 'option';
     $inputMock = $this->givenAnInputObject();
     $this->whenAnOptionIsRetrievedFromInput($inputMock, $optionName, $expected);
     // Act
     $result = $this->fixture->getOption($inputMock, $optionName, 'parser/defaultPackageName');
     // Assert
     $this->assertSame($expected, $result);
 }