コード例 #1
0
 /**
  * @covers phpDocumentor\Parser\Parser::setPath
  * @covers phpDocumentor\Parser\Parser::getPath
  */
 public function testSettingAndRetrievingTheBasePath()
 {
     // Arrange
     $this->assertSame('', $this->fixture->getPath());
     // Act
     $this->fixture->setPath(sys_get_temp_dir());
     // Assert
     $this->assertSame(sys_get_temp_dir(), $this->fixture->getPath());
 }
コード例 #2
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());
 }
コード例 #3
0
 public function testPathHandling()
 {
     // default is only stripping the opening slash
     $this->assertEquals(ltrim(__FILE__, '/'), $this->fixture->getRelativeFilename(__FILE__));
     // after setting the current directory as root folder; should strip all but filename
     $this->fixture->setPath(dirname(__FILE__));
     $this->assertEquals(basename(__FILE__), $this->fixture->getRelativeFilename(__FILE__));
     // when providing a file in a lower directory it cannot parse and thus it is invalid
     $this->setExpectedException('InvalidArgumentException');
     $this->fixture->getRelativeFilename(realpath(dirname(__FILE__) . '/../phpunit.xml'));
 }