コード例 #1
0
ファイル: FactoryTest.php プロジェクト: pombredanne/tuleap
 public function testSearchByTrackerIdReturnsAnArrayOfASingleObjectIfOneEntryIsFoundByTheDao()
 {
     $data = array('comparator' => Tracker_Rule_Date::COMPARATOR_LESS_THAN_OR_EQUALS, 'source_field_id' => $this->source_field_id, 'target_field_id' => $this->target_field_id, 'tracker_id' => $this->tracker_id, 'id' => 20);
     stub($this->date_rule_dao)->searchByTrackerId()->returnsDar($data);
     $date_rules = $this->date_rule_factory->searchByTrackerId($this->tracker_id);
     $this->assertNotNull($date_rules);
     $this->assertIsA($date_rules, 'array');
     $this->assertCount($date_rules, 1);
     $rule = $date_rules[0];
     $obtained_source_field = $rule->getSourceField();
     $obtained_target_field = $rule->getTargetField();
     $this->assertEqual($obtained_source_field, $this->source_field);
     $this->assertEqual($obtained_target_field, $this->target_field);
     $this->assertEqual($rule->getId(), 20);
 }
コード例 #2
0
 private function getRules()
 {
     return $this->rule_date_factory->searchByTrackerId($this->tracker->getId());
 }