示例#1
0
 private function setUpFields(Tracker_FormElementFactory $formelement_factory)
 {
     $list_field = aSelectboxField()->withId(323)->isUsed()->build();
     $date_field = aMockDateWithoutTimeField()->withId(322)->isUsed()->build();
     $integer_field = anIntegerField()->withId(321)->isUsed()->build();
     $static_bind = aBindStatic()->withField($list_field)->withValues(array(aFieldListStaticValue()->withId($this->static_value_open_bind_id)->withLabel('Open')->build()))->build();
     $list_field->setBind($static_bind);
     stub($formelement_factory)->getFormElementByName($this->tracker_id, $this->list_field_name)->returns($list_field);
     stub($formelement_factory)->getFormElementByName($this->tracker_id, $this->date_field_name)->returns($date_field);
     stub($formelement_factory)->getFormElementByName($this->tracker_id, $this->int_field_name)->returns($integer_field);
     $field_title = mock('Tracker_FormElement_Field_Text');
     stub($field_title)->getFieldDataFromSoapValue()->returns('titre');
     stub($formelement_factory)->getUsedFieldByName($this->tracker_id, 'title')->returns($field_title);
 }
示例#2
0
 public function withFieldId($field_id)
 {
     $this->field = anIntegerField()->withId($field_id)->build();
     return $this;
 }