コード例 #1
0
ファイル: ParserTest.php プロジェクト: n2bh/phpmd
 /**
  * testParserStoreParsingExceptionsInReport
  *
  * @return void
  * @since 1.2.1
  */
 public function testParserStoreParsingExceptionsInReport()
 {
     $report = $this->getReportMock(0);
     $report->expects($this->once())->method('addError');
     $pdepend = $this->getPHPDependMock();
     $pdepend->expects($this->once())->method('getExceptions')->will($this->returnValue(array(new \PDepend\Source\Parser\InvalidStateException(42, __FILE__, 'foo'))));
     $parser = new PHP_PMD_Parser($pdepend);
     $parser->parse($report);
 }
コード例 #2
0
ファイル: ParserTest.php プロジェクト: kingsj/core
 /**
  * Tests that the metrics adapter does not delegate a node without source
  * code file to a registered rule-set.
  *
  * @return void
  * @covers PHP_PMD_Parser
  * @group phpmd
  * @group unittest
  */
 public function testAdapterDoesNotDelegateNonSourceFunctionNodeToRuleSet()
 {
     $adapter = new PHP_PMD_Parser($this->_getPHPDependMock());
     $adapter->addRuleSet($this->getRuleSetMock());
     $adapter->setReport($this->getReportMock(0));
     $adapter->visitFunction($this->getPHPDependFunctionMock(null));
 }