lithium\tests\cases\test\filter\ComplexityTest::testAnalyze PHP Method

testAnalyze() public method

Tests the analyze method which compacts the test results and provides a convenient summary of the complexity filter (class average and worst offenders).
See also: lithium\test\filter\Complexity::analyze()
public testAnalyze ( )
    public function testAnalyze()
    {
        $group = new GroupMock();
        $group->add($this->_paths['testClassTest']);
        $this->report->group = $group;
        $this->report->results['filters'] = array('lithium\\test\\filter\\Complexity' => $this->_metrics);
        $results = Complexity::analyze($this->report);
        $expected = array('class' => array($this->_paths['testClass'] => 3.5), 'max' => array('FooObject::invokeMethod()' => 8, 'FooObject::applyFilter()' => 5, 'FooObject::_filter()' => 3, 'FooObject::_parents()' => 2, 'FooObject::_instance()' => 2, 'FooObject::_stop()' => 1));
        $this->assertEqual($expected['max'], $results['max']);
        $result = round($results['class'][$this->_paths['testClass']], 1);
        $this->assertIdentical($expected['class'][$this->_paths['testClass']], $result);
    }