/**
* Tests the `analyze` method which compacts the test results and provides a convenient
* summary of the complexity filter (class average and worst offenders).
*
* @see lithium\test\filter\Complexity::analyze()
*/
public function testAnalyze()
{
extract($this->_paths);
$group = new Group();
$group->add($testClassTest);
$this->report->group = $group;
Complexity::apply($this->report, $group->tests());
$results = Complexity::analyze($this->report);
$expected = array('class' => array($testClass => 3));
foreach ($this->_metrics as $method => $metric) {
$expected['max'][$testClass . '::' . $method . '()'] = $metric;
}
$this->assertEqual($expected['max'], $results['max']);
$this->assertEqual($expected['class'][$testClass], round($results['class'][$testClass]));
}