本文整理汇总了PHP中Tracker_FormElementFactory::setInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_FormElementFactory::setInstance方法的具体用法?PHP Tracker_FormElementFactory::setInstance怎么用?PHP Tracker_FormElementFactory::setInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker_FormElementFactory
的用法示例。
在下文中一共展示了Tracker_FormElementFactory::setInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->user_manager = mock('UserManager');
UserManager::setInstance($this->user_manager);
$this->formelement_factory = mock('Tracker_FormElementFactory');
Tracker_FormElementFactory::setInstance($this->formelement_factory);
}
示例2: setUp
public function setUp()
{
parent::setUp();
$this->user = mock('User');
$this->field = TestHelper::getPartialMock('Tracker_FormElement_Field_Computed', array('getProperty'));
stub($this->field)->getProperty()->returns('effort');
$this->formelement_factory = mock('Tracker_FormElementFactory');
Tracker_FormElementFactory::setInstance($this->formelement_factory);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$this->current_user = aUser()->build();
$this->form_element_factory = mock('Tracker_FormElementFactory');
Tracker_FormElementFactory::setInstance($this->form_element_factory);
$this->dao = mock('Tracker_Chart_Burndown_Data_LinkedArtifactsDao');
stub($this->dao)->searchRemainingEffort()->returns(array());
$this->burndown_data = TestHelper::getPartialMock('Tracker_Chart_Burndown_Data_LinkedArtifacts', array('getBurndownDao'));
stub($this->burndown_data)->getBurndownDao()->returns($this->dao);
}
示例4: setUp
public function setUp()
{
parent::setUp();
$this->field = stub('Tracker_FormElement_Field_String')->getId()->returns($this->field_id);
$element_factory = mock('Tracker_FormElementFactory');
stub($element_factory)->getFormElementById($this->field_id)->returns($this->field);
Tracker_FormElementFactory::setInstance($element_factory);
$this->dao = mock('Workflow_Transition_Condition_FieldNotEmpty_Dao');
$this->factory = new Workflow_Transition_Condition_FieldNotEmpty_Factory($this->dao, $element_factory);
$this->transition = stub('Transition')->getId()->returns(42);
$this->field_string = stub('Tracker_FormElement_Field_String')->getId()->returns(0);
$this->xml_mapping = array('F14' => $this->field_string);
}
示例5: setUp
public function setUp()
{
parent::setUp();
$this->user = mock('PFUser');
$this->dao = mock('Tracker_FormElement_Field_ComputedDao');
$this->field = TestHelper::getPartialMock('Tracker_FormElement_Field_Computed', array('getProperty', 'getDao'));
stub($this->field)->getProperty('target_field_name')->returns('effort');
stub($this->field)->getProperty('fast_compute')->returns(1);
stub($this->field)->getDao()->returns($this->dao);
$this->artifact_factory = mock('Tracker_ArtifactFactory');
Tracker_ArtifactFactory::setInstance($this->artifact_factory);
$this->formelement_factory = mock('Tracker_FormElementFactory');
Tracker_FormElementFactory::setInstance($this->formelement_factory);
}
示例6: setUp
public function setUp()
{
parent::setUp();
$factory = mock('Tracker_FormElementFactory');
$this->field = mock('Tracker_FormElement_Field_Selectbox');
stub($this->field)->getId()->returns(123);
stub($this->field)->isEmpty($this->not_empty_data, '*')->returns(false);
stub($this->field)->isEmpty($this->empty_data, '*')->returns(true);
stub($this->field)->isEmpty(null, '*')->returns(true);
stub($factory)->getUsedFormElementById(123)->returns($this->field);
Tracker_FormElementFactory::setInstance($factory);
$this->dao = mock('Workflow_Transition_Condition_FieldNotEmpty_Dao');
$this->transition = stub('Transition')->getId()->returns(42);
$this->condition = new Workflow_Transition_Condition_FieldNotEmpty($this->transition, $this->dao);
$this->artifact = mock('Tracker_Artifact');
$this->changeset = mock('Tracker_Artifact_Changeset');
stub($this->artifact)->getLastChangeset()->returns($this->changeset);
$this->previous_value = mock('Tracker_Artifact_ChangesetValue');
}
示例7: GivenFormElementFactoryHasOnlyStartDateField
private function GivenFormElementFactoryHasOnlyStartDateField()
{
Tracker_FormElementFactory::clearInstance();
$form_element_factory = mock('Tracker_FormElementFactory');
stub($form_element_factory)->getUsedFieldByNameForUser($this->sprint_tracker_id, 'start_date', $this->current_user)->returns($this->start_date_field);
Tracker_FormElementFactory::setInstance($form_element_factory);
}