public function add($test = null, array $options = array())
{
$resolve = function ($self, $test) {
switch (true) {
case !$test:
return array();
case is_object($test) && $test instanceof Unit:
return array(get_class($test));
case is_string($test) && !file_exists(Libraries::path($test)):
return $self->invokeMethod('_resolve', array($test));
default:
return (array) $test;
}
};
if (is_array($test)) {
foreach ($test as $t) {
$this->_data = array_filter(array_merge($this->_data, $resolve($this, $t)));
}
return $this->_data;
}
return $this->_data = array_merge($this->_data, $resolve($this, $test));
}
public function testCyclicDependency() { $group = new Group(); $group->add('lithium\\tests\\cases\\g11n\\CatalogTest'); $group->add('lithium\\tests\\cases\\g11n\\MessageTest'); $this->report->group = $group; $tests = Affected::apply($this->report, $group->tests()); $expected = array('lithium\\tests\\cases\\g11n\\CatalogTest', 'lithium\\tests\\cases\\g11n\\MessageTest', 'lithium\\tests\\cases\\console\\command\\g11n\\ExtractTest'); $result = $tests->map('get_class', array('collect' => false)); $this->assertEqual($expected, $result); }