当前位置: 首页>>代码示例>>PHP>>正文


PHP TrackerFactory::setInstance方法代码示例

本文整理汇总了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);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:CardwallConfigXmlExportTest.php

示例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);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:ChangesetValueArtifactLinkXMLExporterTest.php

示例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;
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:12,代码来源:MilestoneControllerTest.php


注:本文中的TrackerFactory::setInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。