當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tracker_FormElementFactory::setInstance方法代碼示例

本文整理匯總了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);
 }
開發者ID:rinodung,項目名稱:tuleap,代碼行數:8,代碼來源:XMLExportTest.php

示例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);
 }
開發者ID:nterray,項目名稱:tuleap,代碼行數:9,代碼來源:Tracker_FormElement_Field_ComputedTest.php

示例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);
 }
開發者ID:nterray,項目名稱:tuleap,代碼行數:11,代碼來源:LinkedArtifactsTest.php

示例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);
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:13,代碼來源:FactoryTest.php

示例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);
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:14,代碼來源:Tracker_FormElement_Field_ComputedTest.php

示例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');
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:19,代碼來源:FieldNotEmptyTest.php

示例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);
 }
開發者ID:nterray,項目名稱:tuleap,代碼行數:7,代碼來源:Tracker_FormElement_Field_BurndownTest.php


注:本文中的Tracker_FormElementFactory::setInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。