本文整理匯總了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);
}