lithium\test\filter\Affected::analyze PHP Method

analyze() public static method

Analyzes the results of a test run and returns the result of the analysis.
public static analyze ( object $report, array $options = [] ) : array
$report object The report instance running this filter and aggregating results
$options array
return array The results of the analysis.
    public static function analyze($report, array $options = array())
    {
        $analyze = array();
        foreach ($report->results['filters'][__CLASS__] as $result) {
            foreach ($result as $class => $test) {
                $analyze[$class] = $test;
            }
        }
        return $analyze;
    }

Usage Example

Example #1
0
 public function testAnalyze()
 {
     $ns = 'lithium\\tests\\cases';
     $expected = array('lithium\\g11n\\Message' => "{$ns}\\g11n\\MessageTest", 'lithium\\console\\command\\g11n\\Extract' => "{$ns}\\console\\command\\g11n\\ExtractTest");
     $group = new Group();
     $group->add('lithium\\tests\\cases\\g11n\\CatalogTest');
     $this->report->group = $group;
     $tests = Affected::apply($this->report, $group->tests());
     $results = Affected::analyze($this->report);
     $this->assertEqual($results, $expected);
 }