/** * 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); }
/** * 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)); }