本文整理汇总了PHP中aMockTracker函数的典型用法代码示例。如果您正苦于以下问题:PHP aMockTracker函数的具体用法?PHP aMockTracker怎么用?PHP aMockTracker使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了aMockTracker函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$this->field_122 = aSelectBoxField()->withId(122)->build();
$this->field_123 = aSelectBoxField()->withId(123)->build();
$this->field_124 = aSelectBoxField()->withId(124)->build();
$this->status_field = aSelectBoxField()->withId(125)->build();
$group_id = 234;
$this->tracker = aMockTracker()->withId(3)->withProjectId($group_id)->build();
$this->tracker_10 = aMockTracker()->withId(10)->withStatusField($this->status_field)->build();
$this->tracker_20 = aMockTracker()->withId(20)->build();
$project_trackers = array(3 => $this->tracker, 10 => $this->tracker_10, 20 => $this->tracker_20);
$tracker_factory = stub('TrackerFactory')->getTrackersByGroupId($group_id)->returns($project_trackers);
foreach ($project_trackers as $t) {
stub($tracker_factory)->getTrackerById($t->getId())->returns($t);
}
$element_factory = mock('Tracker_FormElementFactory');
stub($element_factory)->getFieldById(123)->returns($this->field_123);
stub($element_factory)->getFieldById(124)->returns($this->field_124);
stub($element_factory)->getUsedSbFields($this->tracker_10)->returns(array($this->field_122, $this->field_123));
stub($element_factory)->getUsedSbFields()->returns(array());
$this->dao = mock('Cardwall_OnTop_ColumnMappingFieldDao');
$this->value_mapping_factory = mock('Cardwall_OnTop_Config_ValueMappingFactory');
stub($this->value_mapping_factory)->getMappings()->returns(array());
stub($this->value_mapping_factory)->getStatusMappings()->returns(array());
$this->columns = new Cardwall_OnTop_Config_ColumnFreestyleCollection(array(new Cardwall_Column(1, 'Todo', 'white', 'black'), new Cardwall_Column(2, 'On Going', 'white', 'black'), new Cardwall_Column(3, 'Done', 'white', 'black')));
$this->factory = new Cardwall_OnTop_Config_TrackerMappingFactory($tracker_factory, $element_factory, $this->dao, $this->value_mapping_factory);
}
示例2: itsFieldIsNull
public function itsFieldIsNull()
{
$tracker = aMockTracker()->build();
$available_fields = array();
$mapping = new Cardwall_OnTop_Config_TrackerMappingNoField($tracker, $available_fields);
$this->assertNull($mapping->getField());
}
示例3: setUp
public function setUp()
{
parent::setUp();
$changeset_factory = mock('Tracker_Artifact_ChangesetFactory');
$this->tracker = aMockTracker()->withId(1)->build();
$this->new_artifact = partial_mock('Tracker_Artifact', array('createNewChangeset'));
$this->new_artifact->setId($this->new_artifact_id);
$this->layout = mock('Tracker_IDisplayTrackerLayout');
$this->user = mock('PFUser');
$this->xml_exporter = mock('Tracker_XML_Exporter_ArtifactXMLExporter');
$this->xml_importer = mock('Tracker_Artifact_XMLImport');
$this->xml_updater = mock('Tracker_XML_Updater_ChangesetXMLUpdater');
$this->file_updater = mock('Tracker_XML_Updater_TemporaryFileXMLUpdater');
$this->from_changeset = stub('Tracker_Artifact_Changeset')->getId()->returns($this->changeset_id);
$this->from_artifact = partial_mock('Tracker_Artifact', array('getChangesetFactory'));
$this->from_artifact->setId($this->artifact_id);
$this->from_artifact->setTracker($this->tracker);
$this->from_artifact->setChangesets(array($this->changeset_id => $this->from_changeset));
stub($this->from_artifact)->getChangesetFactory()->returns($changeset_factory);
stub($this->from_changeset)->getArtifact()->returns($this->from_artifact);
$this->children_xml_exporter = mock('Tracker_XML_Exporter_ChildrenXMLExporter');
$this->children_xml_importer = mock('Tracker_XML_Importer_ChildrenXMLImporter');
$this->artifacts_imported_mapping = mock('Tracker_XML_Importer_ArtifactImportedMapping');
$backend_logger = mock("BackendLogger");
$this->logger = new Tracker_XML_Importer_CopyArtifactInformationsAggregator($backend_logger);
$this->submitted_values = array();
$this->artifact_factory = mock('Tracker_ArtifactFactory');
stub($this->artifact_factory)->getArtifactByIdUserCanView($this->user, $this->artifact_id)->returns($this->from_artifact);
$this->request = aRequest()->with('from_artifact_id', $this->artifact_id)->with('from_changeset_id', $this->changeset_id)->with('artifact', $this->submitted_values)->build();
$this->action = new Tracker_Action_CopyArtifact($this->tracker, $this->artifact_factory, $this->xml_exporter, $this->xml_importer, $this->xml_updater, $this->file_updater, $this->children_xml_exporter, $this->children_xml_importer, $this->artifacts_imported_mapping, $this->logger);
$this->a_mocked_artifact = mock("Tracker_Artifact");
}
示例4: setUp
public function setUp()
{
parent::setUp();
$this->setUpUsers();
$this->project = stub('Project')->getId()->returns($this->project_id);
$this->tracker = aMockTracker()->withId(120)->withProject($this->project)->build();
$this->artifact_builder = anArtifact()->withTracker($this->tracker);
$this->assignee_retriever = mock('Tracker_Permission_PermissionRetrieveAssignee');
$this->serializer = new Tracker_Permission_PermissionsSerializer($this->assignee_retriever);
}
示例5: setUp
public function setUp()
{
$element_factory = mock('Tracker_FormElementFactory');
$this->dao = mock('Cardwall_OnTop_ColumnMappingFieldValueDao');
$this->factory = new Cardwall_OnTop_Config_ValueMappingFactory($element_factory, $this->dao);
$this->field_124 = aMockField()->withId(124)->build();
stub($element_factory)->getFieldById(124)->returns($this->field_124);
$group_id = 234;
$this->tracker = aMockTracker()->withId(3)->withProjectId($group_id)->build();
$this->tracker_20 = aMockTracker()->withId(20)->build();
stub($this->dao)->searchMappingFieldValues($this->tracker->getId())->returnsDar(array('tracker_id' => 10, 'field_id' => 125, 'value_id' => 1000, 'column_id' => 1), array('tracker_id' => 20, 'field_id' => 124, 'value_id' => 1001, 'column_id' => 1));
}
示例6: setUp
public function setUp()
{
parent::setUp();
$tracker = aMockTracker()->withId(33)->build();
$swimline_tracker = aMockTracker()->build();
$this->artifact = stub('Tracker_Artifact')->getTracker()->returns($tracker);
$this->field = mock('Tracker_FormElement_Field_MultiSelectbox');
$this->field_provider = stub('Cardwall_FieldProviders_IProvideFieldGivenAnArtifact')->getField($this->artifact)->returns($this->field);
$dao = mock('Cardwall_OnTop_Dao');
$column_factory = mock('Cardwall_OnTop_Config_ColumnFactory');
$tracker_mapping_factory = mock('Cardwall_OnTop_Config_TrackerMappingFactory');
$this->config = new Cardwall_OnTop_Config($tracker, $swimline_tracker, $dao, $column_factory, $tracker_mapping_factory);
}
示例7: setUp
public function setUp()
{
parent::setUp();
$planning_tracker_id = 456;
$other_tracker_id = 789;
$this->planning_tracker = aMockTracker()->withId($planning_tracker_id)->build();
$this->other_tracker = aMockTracker()->withId($other_tracker_id)->build();
$planning = stub('Planning')->getBacklogTrackerId()->returns($planning_tracker_id);
$this->artifact = mock('Tracker_Artifact');
$this->node = new TreeNode();
$this->node->setObject($this->artifact);
$this->card_mapper = new TreeNodeMapper(new Planning_ItemCardPresenterCallback($planning, mock('Tracker_CardFields'), mock('User'), 'whatever'));
}
示例8: setUp
public function setUp()
{
$values = array();
foreach (array('new', 'verified', 'fixed') as $i => $value) {
${$value} = mock('Tracker_FormElement_Field_List_Bind_StaticValue');
stub(${$value})->getId()->returns(10 + $i);
stub(${$value})->getLabel()->returns(ucfirst($value));
$values[] = ${$value};
}
$this->status_field = aMockField()->build();
stub($this->status_field)->getVisibleValuesPlusNoneIfAny()->returns($values);
$this->tracker = aMockTracker()->withId(42)->build();
$this->dao = mock('Cardwall_OnTop_ColumnDao');
$this->on_top_dao = mock('Cardwall_OnTop_Dao');
$this->factory = new Cardwall_OnTop_Config_ColumnFactory($this->dao, $this->on_top_dao);
}
示例9: itRendersAWarningForAnyTrackerChildThatHasNoEffortField
public function itRendersAWarningForAnyTrackerChildThatHasNoEffortField()
{
$warning_message = 'Foo';
$this->setText($warning_message, array('plugin_tracker', 'burndown_missing_remaining_effort_warning'));
$stories = aMockTracker()->withName('Stories')->havingFormElementWithNameAndType('remaining_effort', array('int', 'float'))->build();
$bugs = aMockTracker()->withName('Bugs')->havingNoFormElement('remaining_effort')->build();
$chores = aMockTracker()->withName('Chores')->havingFormElementWithNameAndType('remaining_effort', array('int', 'date'))->build();
$children = array($stories, $bugs, $chores);
$tracker_id = 123;
$tracker = aMockTracker()->withId($tracker_id)->build();
$hierarchy_factory = aMockHierarchyFactory()->withChildrenForTrackerId($tracker_id, $children)->build();
$field = aBurndownField()->withTracker($tracker)->withHierarchyFactory($hierarchy_factory)->build();
$html = $field->fetchAdminFormElement();
$this->assertPattern('/' . $warning_message . '/', $html);
$this->assertNoPattern('/Stories/', $html);
$this->assertPattern('/Bugs/', $html);
$this->assertPattern('/Chores/', $html);
}
示例10: setUp
public function setUp()
{
parent::setUp();
$this->tracker = aMockTracker()->build();
$artifact = anArtifact()->withTracker($this->tracker)->build();
$this->user = stub('PFUser')->isSuperUser()->returns(true);
$this->changeset_id = 1234;
$this->changeset = partial_mock('Tracker_Artifact_Changeset', array('getCommentDao', 'getChangesetDao', 'getFormElementFactory', 'getValueDao'), array($this->changeset_id, $artifact, null, null, null));
}
示例11: setUpTrackers
private function setUpTrackers(TrackerFactory $tracker_factory, Project $project, Project $private_project)
{
$this->tracker = aMockTracker()->withId($this->tracker_id)->withProject($project)->withProjectId($project->getGroupId())->build();
$this->unreadable_tracker = aMockTracker()->withId($this->unreadable_tracker_id)->withProject($project)->withProjectId($project->getGroupId())->build();
$this->private_unreadable_tracker = aMockTracker()->withId($this->private_unreadable_tracker_id)->withProject($private_project)->withProjectId($private_project->getGroupId())->build();
stub($this->tracker)->userCanView()->returns(true);
stub($this->tracker)->userIsAdmin()->returns(true);
stub($this->unreadable_tracker)->userCanView()->returns(false);
stub($this->private_unreadable_tracker)->userCanView()->returns(true);
stub($this->private_unreadable_tracker)->userIsAdmin()->returns(true);
stub($tracker_factory)->getTrackerById($this->tracker_id)->returns($this->tracker);
stub($tracker_factory)->getTrackerById($this->unreadable_tracker_id)->returns($this->unreadable_tracker);
stub($tracker_factory)->getTrackerById($this->private_unreadable_tracker_id)->returns($this->private_unreadable_tracker);
}
示例12: setUpTrackers
private function setUpTrackers(TrackerFactory $tracker_factory, Tracker_Hierarchy_Dao $hierarchy_dao)
{
$this->epic_tracker = aMockTracker()->withId(104)->build();
$this->story_tracker = aMockTracker()->withId(103)->build();
$this->release_tracker = aMockTracker()->withId(107)->build();
$this->sprint_tracker = aMockTracker()->withId(108)->build();
$tracker_factory->setCachedInstances(array(104 => $this->epic_tracker, 103 => $this->story_tracker, 107 => $this->release_tracker, 108 => $this->sprint_tracker));
stub($hierarchy_dao)->searchTrackerHierarchy(array(103, 104))->returnsDar(array('parent_id' => '104', 'child_id' => '103'));
stub($hierarchy_dao)->searchTrackerHierarchy(array(108, 107))->returnsDar(array('parent_id' => '107', 'child_id' => '108'));
stub($hierarchy_dao)->searchTrackerHierarchy()->returnsEmptyDar();
}
示例13: itAddsThePlanningAndTheBacklogTrackers
public function itAddsThePlanningAndTheBacklogTrackers()
{
$tracker = aMockTracker()->withId(99)->build();
$dar = TestHelper::arrayToDar(array('id' => 1, 'name' => 'Release Planning', 'group_id' => 102, 'planning_tracker_id' => 103, 'backlog_title' => 'Release Backlog', 'plan_title' => 'Sprint Plan', 'backlog_tracker_id' => 104));
$backlog_tracker_row = array('tracker_id' => 104);
$dao = mock('PlanningDao');
stub($dao)->searchByPlanningTrackerId(99)->returns($dar);
stub($dao)->searchBacklogTrackerById(1)->returns($backlog_tracker_row);
$planning_tracker = aTracker()->withName('planning tracker')->withId(103)->build();
$backlog_tracker = aTracker()->withName('backlog tracker')->withId(104)->build();
$tracker_factory = mock('TrackerFactory');
stub($tracker_factory)->getTrackerById(103)->returns($planning_tracker);
stub($tracker_factory)->getTrackerById(104)->returns($backlog_tracker);
$factory = aPlanningFactory()->withDao($dao)->withTrackerFactory($tracker_factory)->build();
$actual_planning = $factory->getPlanningByPlanningTracker($tracker);
$this->assertEqual($planning_tracker, $actual_planning->getPlanningTracker());
$this->assertEqual($backlog_tracker, $actual_planning->getBacklogTracker());
}
示例14: setUp
public function setUp()
{
parent::setUp();
$this->user = aUser()->withId(111)->build();
$this->artifact = anArtifact()->withTracker(aMockTracker()->build())->build();
$this->builder = new Tracker_REST_Artifact_ArtifactRepresentationBuilder(mock('Tracker_FormElementFactory'));
}
示例15: itDoesNotSendParentWhenParentHasNoRemainingEffortField
public function itDoesNotSendParentWhenParentHasNoRemainingEffortField()
{
$tracker_user_story_id = 110;
$tracker_user_story = aMockTracker()->withId($tracker_user_story_id)->build();
$user_story_id = 111;
$user_story = mock('Tracker_Artifact');
stub($user_story)->getTracker()->returns($tracker_user_story);
stub($user_story)->getId()->returns($user_story_id);
stub($this->hierarchy_factory)->getParentArtifact($this->user, $this->task)->returns($user_story);
$expected = array($this->artifact_id => array('remaining_effort' => 42));
expect($GLOBALS['Response'])->sendJSON($expected)->once();
$this->action->process($this->layout, $this->request, $this->user);
}