apply() public static method

Takes an instance of an object (usually a Collection object) containing test instances. Adds affected tests to the test collection.
public static apply ( object $report, array $tests, array $options = [] ) : object
$report object Instance of Report which is calling apply.
$tests array The test to apply this filter on
$options array Not used.
return object Returns the instance of `$tests`.
コード例 #1
0
ファイル: AffectedTest.php プロジェクト: EHER/chegamos
 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);
 }
コード例 #2
0
ファイル: AffectedTest.php プロジェクト: fedeisas/lithium
 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);
 }