public function itCreatesACollectionForOpenAndUnassignedElements()
 {
     $factory = partial_mock('AgileDashboard_Milestone_Backlog_BacklogItemCollectionFactory', array('getUnplannedOpenCollection'), array($this->dao, $this->artifact_factory, $this->form_element_factory, $this->milestone_factory, $this->planning_factory, $this->backlog_item_builder));
     $redirect_to_self = 'tra la la';
     $backlog_item1 = new AgileDashboard_BacklogItemPresenter($this->story1, $redirect_to_self);
     $backlog_item2 = new AgileDashboard_BacklogItemPresenter($this->story2, $redirect_to_self);
     $backlog_item3 = new AgileDashboard_BacklogItemPresenter($this->story3, $redirect_to_self);
     $mixed_collection = new AgileDashboard_Milestone_Backlog_BacklogItemPresenterCollection();
     $mixed_collection->push($backlog_item1);
     $mixed_collection->push($backlog_item2);
     $mixed_collection->push($backlog_item3);
     stub($factory)->getUnplannedOpenCollection()->returns($mixed_collection);
     stub($this->tracker1)->getProject()->returns(mock('Project'));
     $planning1 = mock('Planning');
     $planning2 = mock('Planning');
     stub($this->planning_factory)->getPlannings()->returns(array($planning1, $planning2));
     stub($this->artifact_factory)->getArtifactIdsLinkedToTrackers()->returns(array(12 => true));
     $cleaned_collection = $factory->getUnassignedOpenCollection($this->user, $this->milestone, $this->backlog_strategy, $this->redirect_to_self);
     $this->assertEqual($cleaned_collection->count(), 2);
 }
 public function itReturnsFalseWhenItemDoesntBelongToCollection()
 {
     $collection = new AgileDashboard_Milestone_Backlog_BacklogItemPresenterCollection();
     $collection->push(stub('AgileDashboard_Milestone_Backlog_IBacklogItem')->id()->returns(5));
     $this->assertFalse($collection->containsId(2));
 }