本文整理汇总了PHP中TrackerFactory::setInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP TrackerFactory::setInstance方法的具体用法?PHP TrackerFactory::setInstance怎么用?PHP TrackerFactory::setInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackerFactory
的用法示例。
在下文中一共展示了TrackerFactory::setInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->project = stub('Project')->getId()->returns(140);
$this->tracker1 = aTracker()->withId(214)->build();
$this->tracker2 = aTracker()->withId(614)->build();
$this->root = new SimpleXMLElement('<projects/>');
$this->cardwall_config = stub('Cardwall_OnTop_Config')->isEnabled()->returns(false);
$this->cardwall_config2 = stub('Cardwall_OnTop_Config')->isEnabled()->returns(true);
$this->tracker_factory = stub('TrackerFactory')->getTrackersByGroupId(140)->returns(array(214 => $this->tracker1, 614 => $this->tracker2));
TrackerFactory::setInstance($this->tracker_factory);
$this->config_factory = mock('Cardwall_OnTop_ConfigFactory');
stub($this->config_factory)->getOnTopConfig($this->tracker1)->returns($this->cardwall_config);
stub($this->config_factory)->getOnTopConfig($this->tracker2)->returns($this->cardwall_config2);
$this->xml_validator = mock('XML_RNGValidator');
$this->xml_exporter = new CardwallConfigXmlExport($this->project, $this->tracker_factory, $this->config_factory, $this->xml_validator);
}
示例2: setUp
public function setUp()
{
parent::setUp();
$tracker_factory = mock('TrackerFactory');
TrackerFactory::setInstance($tracker_factory);
$this->user = aUser()->build();
$story_tracker = aTracker()->withId(100)->build();
$task_tracker = aTracker()->withId(101)->build();
$bug_tracker = aTracker()->withId(102)->build();
$dayoff_tracker = aTracker()->withId(103)->build();
$story_tracker->setChildren(array($task_tracker, $bug_tracker));
stub($tracker_factory)->getTrackerById(100)->returns($story_tracker);
stub($tracker_factory)->getTrackerById(101)->returns($task_tracker);
stub($tracker_factory)->getTrackerById(102)->returns($bug_tracker);
stub($tracker_factory)->getTrackerById(103)->returns($dayoff_tracker);
$this->collector = new Tracker_XML_ChildrenCollector();
$this->field = aFileField()->withTracker($story_tracker)->withName('artifact links')->build();
$this->exporter = new Tracker_XML_Exporter_ChangesetValue_ChangesetValueArtifactLinkXMLExporter($this->collector, $this->user);
$this->artifact_xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><artifact />');
$this->changeset_xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><changeset />');
$this->changeset_value = mock('Tracker_Artifact_ChangesetValue_ArtifactLink');
stub($this->changeset_value)->getField()->returns($this->field);
}
示例3: WhenICaptureTheOutputOfShowActionWithViewBuilder
private function WhenICaptureTheOutputOfShowActionWithViewBuilder($request, $milestone, $view_builder, array $projects, $search)
{
$project_manager = $this->GivenAProjectManagerThatReturns($projects);
$tracker_factory = new MockTrackerFactory();
TrackerFactory::setInstance($tracker_factory);
stub($this->milestone_factory)->getMilestoneWithPlannedArtifactsAndSubMilestones($request->getCurrentUser(), $project_manager->getProject($request->get('group_id')), $request->get('planning_id'), $request->get('aid'))->returns($milestone);
ob_start();
$controller = new Planning_MilestoneController($request, $this->milestone_factory, $project_manager);
$controller->show($view_builder, $project_manager, $search);
$content = ob_get_clean();
return $content;
}