コード例 #1
0
 public function setUp()
 {
     parent::setUp();
     $this->user = mock('PFUser');
     $this->dao = mock('Tracker_FormElement_Field_ComputedDao');
     $this->field = TestHelper::getPartialMock('Tracker_FormElement_Field_Computed', array('getProperty', 'getDao'));
     stub($this->field)->getProperty('target_field_name')->returns('effort');
     stub($this->field)->getProperty('fast_compute')->returns(1);
     stub($this->field)->getDao()->returns($this->dao);
     $this->artifact_factory = mock('Tracker_ArtifactFactory');
     Tracker_ArtifactFactory::setInstance($this->artifact_factory);
     $this->formelement_factory = mock('Tracker_FormElementFactory');
     Tracker_FormElementFactory::setInstance($this->formelement_factory);
 }
コード例 #2
0
 public function setUp()
 {
     parent::setUp();
     $this->form_element_factory = new MockTracker_FormElementFactory();
     $this->semantic_factory = new MockTracker_CrossSearch_SemanticValueFactory();
     $this->planning_trackers = array();
     $this->artifact_factory = new MockTracker_ArtifactFactory();
     Tracker_ArtifactFactory::setInstance($this->artifact_factory);
     $this->project = new MockProject();
     $this->report = new MockTracker_Report();
     $this->user = mock('User');
     stub($this->semantic_factory)->allTitlesAreReadable($this->user, $this->project)->returns(true);
     stub($this->semantic_factory)->allStatusesAreReadable($this->user, $this->project)->returns(true);
 }
コード例 #3
0
 public function setUp()
 {
     parent::setUp();
     $this->user = mock('User');
     $this->planning_tracker_id = 191;
     $this->planning_tracker = mock('Tracker');
     $this->planning = mock('Planning');
     $this->content_view = mock('Tracker_CrossSearch_SearchContentView');
     $this->artifacts_to_select = array();
     $this->artifact = null;
     $factory = mock('Tracker_ArtifactFactory');
     Tracker_ArtifactFactory::setInstance($factory);
     $this->generateABunchOfArtifacts($factory);
     $hierarchy_factory = mock('Tracker_Hierarchy_HierarchicalTrackerFactory');
     Tracker_Hierarchy_HierarchicalTrackerFactory::setInstance($hierarchy_factory);
     stub($this->planning)->getPlanningTrackerId()->returns($this->planning_tracker_id);
     stub($this->planning)->getPlanningTracker()->returns($this->planning_tracker);
     stub($this->planning_tracker)->getId()->returns($this->planning_tracker_id);
 }
コード例 #4
0
 public function itMustNotBuildBurndownWhenArtifactDoesNotExist()
 {
     $request = new Codendi_Request(array('formElement' => 1234, 'func' => Tracker_FormElement_Field_Burndown::FUNC_SHOW_BURNDOWN, 'src_aid' => 999));
     $artifactFactory = stub('Tracker_ArtifactFactory')->getArtifactById()->returns(null);
     Tracker_ArtifactFactory::setInstance($artifactFactory);
     $this->field->expectNever('fetchBurndownImage');
     $this->field->process($this->tracker_manager, $request, $this->current_user);
 }