本文整理汇总了PHP中aUser函数的典型用法代码示例。如果您正苦于以下问题:PHP aUser函数的具体用法?PHP aUser怎么用?PHP aUser使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了aUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
/*
Product Epic
Release ----,-- Story
Sprint ---' Task
*/
$this->user = aUser()->build();
$this->release_tracker_id = 101;
$this->sprint_tracker_id = 1001;
$this->task_tracker_project_id = 200;
$this->epic_tracker = aTracker()->withId('epic')->withParent(null)->build();
$this->story_tracker = aTracker()->withId('story')->withParent($this->epic_tracker)->build();
$this->task_tracker = aTracker()->withId('task')->withProjectId($this->task_tracker_project_id)->withParent($this->story_tracker)->build();
$this->product_tracker = aTracker()->withId('product')->withParent(null)->build();
$this->release_tracker = aTracker()->withId($this->release_tracker_id)->withParent($this->product_tracker)->build();
$this->sprint_tracker = aTracker()->withId($this->sprint_tracker_id)->withParent($this->epic_tracker)->build();
$release_planning = stub('Planning')->getPlanningTracker()->returns($this->release_tracker);
$sprint_planning = stub('Planning')->getPlanningTracker()->returns($this->sprint_tracker);
$top_planning = stub('Planning')->getBacklogTrackersIds()->returns(array($this->release_tracker_id, $this->sprint_tracker_id));
$this->planning_factory = mock('PlanningFactory');
stub($this->planning_factory)->getPlanningByPlanningTracker($this->product_tracker)->returns(null);
stub($this->planning_factory)->getPlanningByPlanningTracker($this->release_tracker)->returns($release_planning);
stub($this->planning_factory)->getPlanningByPlanningTracker($this->sprint_tracker)->returns($sprint_planning);
stub($this->planning_factory)->getVirtualTopPlanning($this->user, $this->task_tracker_project_id)->returns($top_planning);
$this->hierarchy_factory = mock('Tracker_HierarchyFactory');
stub($this->hierarchy_factory)->getAllParents($this->sprint_tracker)->returns(array($this->release_tracker, $this->product_tracker));
$this->dao = mock('AgileDashboard_Milestone_MilestoneDao');
stub($this->dao)->getAllMilestoneByTrackers(array($this->release_tracker_id, $this->sprint_tracker_id))->returnsDar(array('m101_id' => '123', 'm101_title' => 'Tuleap 6.5', 'm1001_id' => '1231', 'm1001_title' => 'Sprint 31'), array('m101_id' => '123', 'm101_title' => 'Tuleap 6.5', 'm1001_id' => '1232', 'm1001_title' => 'Sprint 32'), array('m101_id' => '124', 'm101_title' => 'Tuleap 6.6', 'm1001_id' => '1241', 'm1001_title' => 'Sprint 33'));
$this->nearest_planning_tracker_provider = mock('AgileDashboard_Planning_NearestPlanningTrackerProvider');
$this->provider = new AgileDashboard_Milestone_MilestoneReportCriterionOptionsProvider($this->nearest_planning_tracker_provider, $this->dao, $this->hierarchy_factory, $this->planning_factory);
}
示例2: setUp
public function setUp()
{
parent::setUp();
$tracker_factory = mock('TrackerFactory');
$this->xml_importer = mock('Tracker_Artifact_XMLImport');
$this->artifact_factory = mock('Tracker_ArtifactFactory');
$this->children_collector = new Tracker_XML_ChildrenCollector();
$this->importer = new Tracker_XML_Importer_ChildrenXMLImporter($this->xml_importer, $tracker_factory, $this->artifact_factory, $this->children_collector);
$this->artifacts_imported_mapping = mock('Tracker_XML_Importer_ArtifactImportedMapping');
$this->tracker = aTracker()->withId(23)->build();
stub($tracker_factory)->getTrackerById(23)->returns($this->tracker);
$this->tracker_2 = aTracker()->withId(24)->build();
stub($tracker_factory)->getTrackerById(24)->returns($this->tracker_2);
$this->user = aUser()->build();
$artlink_field = anArtifactLinkField()->withId($this->field_id)->build();
$artlink_field_2 = anArtifactLinkField()->withId($this->field_id_2)->build();
$root_artifact_id = 456;
$this->root_artifact = mock('Tracker_Artifact');
stub($this->root_artifact)->getId()->returns($root_artifact_id);
stub($this->root_artifact)->getAnArtifactLinkField($this->user)->returns($artlink_field);
stub($this->artifact_factory)->getArtifactById($root_artifact_id)->returns($this->root_artifact);
$this->created_artifact = mock('Tracker_Artifact');
stub($this->created_artifact)->getId()->returns(1023);
stub($this->created_artifact)->getAnArtifactLinkField($this->user)->returns($artlink_field_2);
stub($this->artifact_factory)->getArtifactById(1023)->returns($this->created_artifact);
$this->another_child_artifact = anArtifact()->withId(1024)->build();
stub($this->artifact_factory)->getArtifactById(1024)->returns($this->another_child_artifact);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$this->milestone_1_id = 132;
$this->milestone_1 = stub('Planning_ArtifactMilestone')->getArtifactId()->returns($this->milestone_1_id);
$this->milestone_2_id = 853;
$this->milestone_2 = stub('Planning_ArtifactMilestone')->getArtifactId()->returns($this->milestone_2_id);
$this->virtual_top_milestone = stub('Planning_VirtualTopMilestone')->getArtifactId()->returns(null);
$this->strategy_1 = mock('AgileDashboard_Milestone_Backlog_DescendantBacklogStrategy');
$this->strategy_2 = mock('AgileDashboard_Milestone_Backlog_DescendantBacklogStrategy');
$this->strategy_factory = mock('AgileDashboard_Milestone_Backlog_BacklogStrategyFactory');
stub($this->strategy_factory)->getBacklogStrategy($this->milestone_1)->returns($this->strategy_1);
stub($this->strategy_factory)->getBacklogStrategy($this->milestone_2)->returns($this->strategy_2);
$this->backlog_item_collection_factory = mock('AgileDashboard_Milestone_Backlog_BacklogItemCollectionFactory');
$this->sequence_id_manager = new AgileDashboard_SequenceIdManager($this->strategy_factory, $this->backlog_item_collection_factory);
$this->user = aUser()->build();
$this->artifact_id_1 = 123;
$this->artifact_id_2 = 456;
$this->artifact_id_3 = 789;
$this->artifact_1 = anArtifact()->withId($this->artifact_id_1)->build();
$this->artifact_2 = anArtifact()->withId($this->artifact_id_2)->build();
$this->artifact_3 = anArtifact()->withId($this->artifact_id_3)->build();
$this->artifact_id_4 = 254;
$this->artifact_id_5 = 255;
$this->artifact_id_6 = 256;
$this->artifact_4 = anArtifact()->withId($this->artifact_id_4)->build();
$this->artifact_5 = anArtifact()->withId($this->artifact_id_5)->build();
$this->artifact_6 = anArtifact()->withId($this->artifact_id_6)->build();
$this->backlog_item_1 = stub('AgileDashboard_Milestone_Backlog_BacklogItem')->getArtifact()->returns($this->artifact_1);
$this->backlog_item_2 = stub('AgileDashboard_Milestone_Backlog_BacklogItem')->getArtifact()->returns($this->artifact_2);
$this->backlog_item_3 = stub('AgileDashboard_Milestone_Backlog_BacklogItem')->getArtifact()->returns($this->artifact_3);
$this->items_collection = new AgileDashboard_Milestone_Backlog_BacklogItemCollection();
}
示例4: setUp
public function setUp()
{
$this->user = aUser()->build();
$this->tracker = mock('Tracker');
$summary_field = mock('Tracker_FormElement_Field_Text');
stub($summary_field)->getName()->returns('summary');
stub($summary_field)->userCanRead()->returns(true);
$assigned_to_field = mock('Tracker_FormElement_Field_List');
stub($assigned_to_field)->getName()->returns('assigned_to');
stub($assigned_to_field)->userCanRead()->returns(true);
$values_field = mock('Tracker_FormElement_Field_List');
stub($values_field)->getName()->returns('status');
stub($values_field)->userCanRead()->returns(true);
$unreable_field = mock('Tracker_FormElement_Field_Text');
stub($unreable_field)->getName()->returns('whatever');
stub($unreable_field)->userCanRead()->returns(false);
$unreable_field_list = mock('Tracker_FormElement_Field_List');
stub($unreable_field_list)->getName()->returns('whatever');
stub($unreable_field_list)->userCanRead()->returns(false);
$this->semantic_title = new Tracker_Semantic_Title($this->tracker, $summary_field);
$this->unreadable_semantic_title = new Tracker_Semantic_Title($this->tracker, $unreable_field);
$this->semantic_contributor = new Tracker_Semantic_Contributor($this->tracker, $assigned_to_field);
$this->unreadable_semantic_contributor = new Tracker_Semantic_Contributor($this->tracker, $unreable_field_list);
$this->semantic_status = new Tracker_Semantic_Status($this->tracker, $values_field, $this->open_values);
$this->unreadable_semantic_status = new Tracker_Semantic_Status($this->tracker, $unreable_field_list, $this->open_values);
$this->semantic_tooltip = new Tracker_Tooltip($this->tracker);
$this->not_defined_semantic_title = new Tracker_Semantic_Title($this->tracker);
$this->not_defined_semantic_status = new Tracker_Semantic_Status($this->tracker);
$this->not_defined_semantic_contributor = new Tracker_Semantic_Contributor($this->tracker);
$this->semantic_manager = partial_mock('Tracker_SemanticManager', array('getSemantics', 'getSemanticOrder'), array($this->tracker));
stub($this->semantic_manager)->getSemanticOrder()->returns(array('title', 'status', 'contributor'));
}
示例5: itCollectsUserById
public function itCollectsUserById()
{
$user = aUser()->withId(101)->withLdapId('ldap_01')->withUserName('user_01')->build();
stub($this->user_manager)->getUserById(101)->returns($user);
expect($this->collection)->add($user)->once();
$this->user_xml_exporter->exportUserByUserId(101, $this->base_xml, 'user');
}
示例6: GivenAnArtifact
private function GivenAnArtifact($tracker)
{
$artifact = TestHelper::getPartialMock('Tracker_Artifact', array('createNewChangeset', 'getUserManager'));
$user_manager = stub('UserManager')->getCurrentUser()->returns(aUser()->withId(120)->build());
stub($artifact)->getUserManager()->returns($user_manager);
$artifact->setTracker($tracker);
return $artifact;
}
示例7: itReturnsTheRESTValue
public function itReturnsTheRESTValue()
{
$field = stub('Tracker_FormElement_Field_String')->getName()->returns('field_string');
$user = aUser()->withId(101)->build();
$changeset = new Tracker_Artifact_ChangesetValue_String(111, $field, true, 'myxedemic enthymematic', 'text');
$representation = $changeset->getRESTValue($user, $changeset);
$this->assertEqual($representation->value, 'myxedemic enthymematic');
}
示例8: itExportsTheComments
public function itExportsTheComments()
{
$user = aUser()->withId(101)->withLdapId('ldap_01')->withUserName('user_01')->build();
stub($this->user_manager)->getUserById(101)->returns($user);
expect($this->values_exporter)->exportChangedFields($this->artifact_xml, '*', $this->artifact, $this->values)->once();
expect($this->comment)->exportToXML()->once();
$this->exporter->exportFullHistory($this->artifact_xml, $this->changeset);
}
示例9: itReturnsTheRESTValue
public function itReturnsTheRESTValue()
{
$field = stub('Tracker_FormElement_Field_Integer')->getName()->returns('field_int');
$user = aUser()->withId(101)->build();
$changeset = new Tracker_Artifact_ChangesetValue_Integer(111, $field, true, 556);
$representation = $changeset->getRESTValue($user, $changeset);
$this->assertEqual($representation->value, 556);
}
示例10: setUp
public function setUp()
{
parent::setUp();
$this->key1 = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxo4yIDI6bkSUVgXMZYmBZNDl3ttYUIxaThIX1hjp+Oxjo1yeI+vytb1UvESnu1fAhNB40KpPwL7md+UwfHyo2Jah9PMq6bfrSupAE6NOJQ4xG5W7hP70ih5UZtA9YuZfzDc7JsCpwlF7Fvhc+1u4uRYxuKQ+4SpzxCNkmMAMD9BzjXq0Jt/6MsEz+Txt6xoo+HAZXUnUq/XgqMh1A71zAjz6E1ADsd1vLYekQruy9uzhnq9Q7bi+evS1bvi7/O+csAqpIvN/stBqIzALpoAGY1Ek/YMKxjzNurnRTtwEuvqciaPk4aZGg5UvWL1B+yo7HuG/Je0KSz/+u+1efqLUxw== user@shunt';
$this->key2 = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAo2Z2ru57hk2p9wMkM66IxYV1HFKEJvWjWi7Otug/G14LWwO1VU5wNBJgJEfaAoL7ccRpWYpRKLAZdAPYq8nOVFsTU0X4z4mtIo8L1mlw+qXZ3KW77/QJ7sNbCZe6vpNcKg0+DX0e4n0h6R+lXIwi/ISM6wXPQU3uUKVRbcykC9YwEnQokFXXHRqeBzPjyRFval4SRMHAdcs2pjZtu5Et0pObR+Lrs532NE1tvDUrPbU1Oy+9w7bbcvbfjKeYX7FgdXmlYDYLcAfZG4wCHBBYbp5HNXTxhwv4wHq7Z20tEN4qqBnehCGPOpBIgbfBTdN9NftloRYrVPNAxKXhPd/VRQ== user@crampons';
$this->user = aUser()->build();
$this->validator = new User_SSHKeyValidator();
}
示例11: setUp
public function setUp()
{
parent::setUp();
$user = aUser()->withId(101)->withLdapId('ldap_01')->withUserName('user_01')->build();
$this->changeset = aChangeset()->build();
$this->timestamp = '1433863107';
$this->user_manager = stub('UserManager')->getUserById(101)->returns($user);
UserManager::setInstance($this->user_manager);
}
示例12: setUp
public function setUp()
{
parent::setUp();
$this->backlog_dao = mock('AgileDashboard_BacklogItemDao');
$this->artifact_dao = mock('Tracker_ArtifactDao');
$this->artifact_factory = mock('Tracker_ArtifactFactory');
$this->user = aUser()->build();
$this->counter = new AgileDashboard_Milestone_MilestoneStatusCounter($this->backlog_dao, $this->artifact_dao, $this->artifact_factory);
}
示例13: itExportsUserInXMLByItsId
public function itExportsUserInXMLByItsId() {
$user = aUser()->withId(101)->withLdapId('ldap_01')->withUserName('user_01')->build();
stub($this->user_manager)->getUserById(101)->returns($user);
$this->user_xml_exporter->exportUserByUserId(101, $this->base_xml, 'user');
$this->assertEqual((string) $this->base_xml->user['format'], 'ldap');
$this->assertEqual((string) $this->base_xml->user, 'ldap_01');
}
示例14: setUp
public function setUp()
{
parent::setUp();
$this->tracker_id = 12;
$this->tracker = aTracker()->withId($this->tracker_id)->build();
$this->user_id = 32;
$this->user = aUser()->withId($this->user_id)->build();
$this->report_factory = partial_mock('Tracker_ReportFactory', array('getReportsByTrackerId'));
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->task_tracker = aTracker()->withId('task')->build();
$this->options_provider = mock('AgileDashboard_Milestone_MilestoneReportCriterionOptionsProvider');
$this->milestone_id_provider = mock('AgileDashboard_Milestone_SelectedMilestoneProvider');
$this->user = aUser()->build();
$this->provider = new AgileDashboard_Milestone_MilestoneReportCriterionProvider($this->milestone_id_provider, $this->options_provider);
}