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


PHP Tracker_FormElementFactory::setReturnValue方法代碼示例

本文整理匯總了PHP中Tracker_FormElementFactory::setReturnValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracker_FormElementFactory::setReturnValue方法的具體用法?PHP Tracker_FormElementFactory::setReturnValue怎麽用?PHP Tracker_FormElementFactory::setReturnValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tracker_FormElementFactory的用法示例。


在下文中一共展示了Tracker_FormElementFactory::setReturnValue方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->factory = mock('Tracker_FormElementFactory');
     $this->new_changeset_fields_validator = new Tracker_Artifact_Changeset_NewChangesetFieldsValidator($this->factory);
     $this->initial_changeset_fields_validator = new Tracker_Artifact_Changeset_InitialChangesetFieldsValidator($this->factory);
     $this->field1 = $this->getFieldWithId(101);
     $this->field2 = $this->getFieldWithId(102);
     $this->field3 = $this->getFieldWithId(103);
     $this->factory->setReturnValue('getAllFormElementsForTracker', array());
     $this->factory->setReturnValue('getUsedFields', array($this->field1, $this->field2, $this->field3));
     $this->workflow = mock('Workflow');
     $this->artifact = aMockArtifact()->withTracker(mock('Tracker'))->build();
     stub($this->artifact)->getWorkflow()->returns($this->workflow);
     $this->changeset = mock('Tracker_Artifact_Changeset');
     $this->changeset_value1 = mock('Tracker_Artifact_ChangesetValue');
     $this->changeset_value2 = mock('Tracker_Artifact_ChangesetValue');
     $this->changeset_value3 = mock('Tracker_Artifact_ChangesetValue');
     stub($this->changeset)->getValue($this->field1)->returns($this->changeset_value1);
     $this->artifact_update = aMockArtifact()->withTracker(mock('Tracker'))->withlastChangeset($this->changeset)->build();
     stub($this->artifact_update)->getWorkflow()->returns($this->workflow);
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:22,代碼來源:FieldsValidatorTest.php


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