lithium\test\filter\Affected::apply()
Overrides
lithium\test\Filter::apply()
Takes an instance of an object (usually a Collection object) containing test instances. Adds affected tests to the test collection.
Parameters
-
object
$report
Instance of Report which is calling apply.
-
array
$tests
The test to apply this filter on
-
array
$options
Not used.
Returns
objectReturns the instance of $tests
.
Source
public static function apply($report, $tests, array $options = array()) {
$affected = array();
$testsClasses = $tests->map('get_class', array('collect' => false));
foreach ($tests as $test) {
$affected = array_merge($affected, self::_affected($test->subject()));
}
$affected = array_unique($affected);
foreach ($affected as $class) {
$test = Unit::get($class);
if ($test && !in_array($test, $testsClasses)) {
$tests[] = new $test();
}
$report->collect(__CLASS__, array($class => $test));
}
return $tests;
}