/** * Tests that the parser handles an interface within an instanceof operator * correct. * * @return void */ public function testAnalyzerReturnsExpectedNPathValue() { $namespaces = self::parseCodeResourceForTest(); $function = $namespaces->current()->getFunctions()->current(); $analyzer = new NPathComplexityAnalyzer(); $analyzer->setCache(new MemoryCacheDriver()); $analyzer->analyze($namespaces); $this->assertEquals(array('npath' => '6'), $analyzer->getNodeMetrics($function)); }
/** * Creates a ready to use npath complexity analyzer. * * @return \PDepend\Metrics\Analyzer\NPathComplexityAnalyzer * @since 1.0.0 */ private function _createAnalyzer() { $analyzer = new NPathComplexityAnalyzer(); $analyzer->setCache($this->cache); return $analyzer; }