Пример #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
 public function testForced()
 {
     // defaults to false
     $this->assertEquals(false, $this->fixture->isForced());
     $xml = new \SimpleXMLElement('<project></project>');
     $xml->addAttribute('version', \phpDocumentor\Application::VERSION);
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(false, $this->fixture->isForced());
     // if version differs, we force a rebuild
     $xml['version'] = \phpDocumentor\Application::VERSION . 'a';
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(true, $this->fixture->isForced());
     // switching back should undo the force
     $xml['version'] = \phpDocumentor\Application::VERSION;
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(false, $this->fixture->isForced());
     // manually setting forced should result in a force
     $this->fixture->setForced(true);
     $this->assertEquals(true, $this->fixture->isForced());
     $this->fixture->setForced(false);
     $this->assertEquals(false, $this->fixture->isForced());
 }
Пример #3
0
 /**
  * @covers phpDocumentor\Parser\Parser::setForced
  * @covers phpDocumentor\Parser\Parser::isForced
  */
 public function testSetAndCheckWhetherParsingIsForced()
 {
     $this->assertEquals(false, $this->fixture->isForced());
     $this->fixture->setForced(true);
     $this->assertEquals(true, $this->fixture->isForced());
 }