Affected test cases are determined by: 1. Looking at the subject of a test case. 2. Searching the class tree for any classes that directly depend on that subject. 3. Assigning test cases to those classes.
Inheritance: extends lithium\test\Filter
Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public function testOutputWithEmptyAnalysis()
 {
     $expected = "Additional Affected Tests\n-------------------------";
     $result = Affected::output('text', array());
     $this->assertEqual($expected, $result);
 }