本文整理匯總了PHP中Tracker_ArtifactFactory::setInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracker_ArtifactFactory::setInstance方法的具體用法?PHP Tracker_ArtifactFactory::setInstance怎麽用?PHP Tracker_ArtifactFactory::setInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tracker_ArtifactFactory
的用法示例。
在下文中一共展示了Tracker_ArtifactFactory::setInstance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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);
}
示例2: setUp
public function setUp()
{
parent::setUp();
$this->form_element_factory = new MockTracker_FormElementFactory();
$this->semantic_factory = new MockTracker_CrossSearch_SemanticValueFactory();
$this->planning_trackers = array();
$this->artifact_factory = new MockTracker_ArtifactFactory();
Tracker_ArtifactFactory::setInstance($this->artifact_factory);
$this->project = new MockProject();
$this->report = new MockTracker_Report();
$this->user = mock('User');
stub($this->semantic_factory)->allTitlesAreReadable($this->user, $this->project)->returns(true);
stub($this->semantic_factory)->allStatusesAreReadable($this->user, $this->project)->returns(true);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$this->user = mock('User');
$this->planning_tracker_id = 191;
$this->planning_tracker = mock('Tracker');
$this->planning = mock('Planning');
$this->content_view = mock('Tracker_CrossSearch_SearchContentView');
$this->artifacts_to_select = array();
$this->artifact = null;
$factory = mock('Tracker_ArtifactFactory');
Tracker_ArtifactFactory::setInstance($factory);
$this->generateABunchOfArtifacts($factory);
$hierarchy_factory = mock('Tracker_Hierarchy_HierarchicalTrackerFactory');
Tracker_Hierarchy_HierarchicalTrackerFactory::setInstance($hierarchy_factory);
stub($this->planning)->getPlanningTrackerId()->returns($this->planning_tracker_id);
stub($this->planning)->getPlanningTracker()->returns($this->planning_tracker);
stub($this->planning_tracker)->getId()->returns($this->planning_tracker_id);
}
示例4: itMustNotBuildBurndownWhenArtifactDoesNotExist
public function itMustNotBuildBurndownWhenArtifactDoesNotExist()
{
$request = new Codendi_Request(array('formElement' => 1234, 'func' => Tracker_FormElement_Field_Burndown::FUNC_SHOW_BURNDOWN, 'src_aid' => 999));
$artifactFactory = stub('Tracker_ArtifactFactory')->getArtifactById()->returns(null);
Tracker_ArtifactFactory::setInstance($artifactFactory);
$this->field->expectNever('fetchBurndownImage');
$this->field->process($this->tracker_manager, $request, $this->current_user);
}