public function itIncludesBreadcrumbsForParentMilestones() { $this->sprint->setAncestors(array($this->release, $this->product)); stub($this->milestone_factory)->getMilestoneWithPlannedArtifactsAndSubMilestones()->returns($this->sprint); $controller = new Planning_MilestoneController($this->request, $this->milestone_factory, $this->project_manager); $breadcrumbs = $controller->getBreadcrumbs($this->plugin_path); $this->assertEqualToBreadCrumbWithAllMilestones($breadcrumbs); }
private function WhenICaptureTheOutputOfShowActionWithViewBuilder($request, $milestone, $view_builder, array $projects) { $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); $hierarchy_factory = mock('Tracker_HierarchyFactory'); stub($hierarchy_factory)->getHierarchy()->returns(new Tracker_Hierarchy()); ob_start(); $controller = new Planning_MilestoneController($request, $this->milestone_factory, $project_manager, $view_builder, $hierarchy_factory); $controller->show(); $content = ob_get_clean(); return $content; }