public function setUp() { parent::setUp(); $this->sprint_1 = mock('Planning_Milestone'); stub($this->sprint_1)->getArtifactId()->returns(1); stub($this->sprint_1)->getArtifactTitle()->returns('Sprint 1'); stub($this->sprint_1)->getPlanning()->returns(aPlanning()->build()); stub($this->sprint_1)->getLinkedArtifacts()->returns(array()); stub($this->sprint_1)->hasAncestors()->returns(true); $this->sprint_2 = aMilestone()->withArtifact(aMockArtifact()->withId(2)->withTitle('Sprint 2')->build())->build(); $this->milestone_factory = mock('Planning_MilestoneFactory'); $this->project_manager = stub('ProjectManager')->getProject()->returns(mock('Project')); $this->current_user = aUser()->build(); $this->request = aRequest()->withUser($this->current_user)->build(); Tracker_HierarchyFactory::setInstance(mock('Tracker_HierarchyFactory')); }