/** * Analyzes the source associated with the calling test and returns the * calculated metric value. * * @param string $testCase Name of the calling test case. * @param string $metric Name of the searched metric. * * @return mixed */ private function _getCalculatedMetric($testCase, $metric) { $packages = self::parseTestCaseSource($testCase); $package = $packages->current(); $analyzer = new PHP_Depend_Metrics_Inheritance_Analyzer(); $analyzer->analyze($packages); $metrics = $analyzer->getNodeMetrics($package->getClasses()->current()); return $metrics[$metric]; }
/** * testAnalyzerNotCountsImplementedInterfaceMethodsAsOverwritten * * @return void * @covers stdClass * @group pdepend * @group pdepend::bugs * @group regressiontest */ public function testAnalyzerNotCountsImplementedInterfaceMethodsAsOverwritten() { $packages = self::parseTestCaseSource(__METHOD__); $class = $packages->current()->getClasses()->current(); $analyzer = new PHP_Depend_Metrics_Inheritance_Analyzer(); $analyzer->analyze($packages); $metrics = $analyzer->getNodeMetrics($class); $this->assertEquals(1, $metrics['noom']); }