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