当前位置: 首页>>代码示例>>PHP>>正文


PHP TestHelper::arrayToDar方法代码示例

本文整理汇总了PHP中TestHelper::arrayToDar方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHelper::arrayToDar方法的具体用法?PHP TestHelper::arrayToDar怎么用?PHP TestHelper::arrayToDar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestHelper的用法示例。


在下文中一共展示了TestHelper::arrayToDar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: itBuildsAnEmptyFreestyleCollectionIfThereIsNothingInTheDaoAndNoStatus

 public function itBuildsAnEmptyFreestyleCollectionIfThereIsNothingInTheDaoAndNoStatus()
 {
     stub($this->tracker)->getStatusField()->returns(null);
     stub($this->dao)->searchColumnsByTrackerId(42)->returns(TestHelper::arrayToDar());
     $columns = $this->factory->getDashboardColumns($this->tracker, $this->swimline_tracker);
     $this->assertIsA($columns, 'Cardwall_OnTop_Config_ColumnFreestyleCollection');
     $this->assertEqual(0, count($columns));
 }
开发者ID:nterray,项目名称:tuleap,代码行数:8,代码来源:ColumnFactoryTest.php

示例2: GivenThereWasAlreadyTenCallToAddProject

 private function GivenThereWasAlreadyTenCallToAddProject()
 {
     $dao = new MockSOAP_RequestLimitatorDao();
     $time30minutesAgo = $_SERVER['REQUEST_TIME'] - 30 * 60;
     $dar = TestHelper::arrayToDar(array('method_name' => 'addProject', 'date' => $time30minutesAgo));
     $dao->setReturnValue('searchFirstCallToMethod', $dar);
     $dao->setReturnValue('foundRows', 10);
     $dao->expectOnce('saveCallToMethod', array('addProject', '*'));
     return $dao;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:SOAP_RequestLimitatorTest.php

示例3: GivenAFullApacheConf

 private function GivenAFullApacheConf()
 {
     $backend = TestHelper::getPartialMock('LDAP_BackendSVN', array('_getServiceDao', 'getLdap', 'getLDAPProjectManager', 'getSVNApacheAuthFactory'));
     $dar = TestHelper::arrayToDar(array('unix_group_name' => 'gpig', 'group_name' => 'Guinea Pig', 'group_id' => 101), array('unix_group_name' => 'garden', 'group_name' => 'The Garden Project', 'group_id' => 102));
     $dao = new MockServiceDao();
     $dao->setReturnValue('searchActiveUnixGroupByUsedService', $dar);
     $backend->setReturnValue('_getServiceDao', $dao);
     $factory = TestHelper::getPartialMock('SVN_Apache_Auth_Factory', array('getEventManager'));
     $factory->setReturnValue('getEventManager', new LDAP_BackendSVNTestEventManager());
     $backend->setReturnValue('getSVNApacheAuthFactory', $factory);
     return $backend->getApacheConf();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:LDAP_BackendSVNTest.php

示例4: itCatchExceptionsInSystemEvents

 public function itCatchExceptionsInSystemEvents()
 {
     $system_event = partial_mock('SysteEvent_For_Testing_Purpose', array('process', 'notify', 'verbalizeParameters'));
     $types = array('some_type');
     stub($this->system_event_manager)->getTypesForQueue()->returns($types);
     $this->system_event_dao->setReturnValueAt(0, 'checkOutNextEvent', TestHelper::arrayToDar(array('whatever')));
     stub($this->system_event_manager)->getInstanceFromRow()->returns($system_event);
     $system_event->throwOn('process', new RuntimeException('Something wrong happened'));
     $category = SystemEvent::DEFAULT_QUEUE;
     $this->processor->execute($category);
     $this->assertEqual($system_event->getStatus(), SystemEvent::STATUS_ERROR);
     $this->assertEqual($system_event->getLog(), 'Something wrong happened');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:SystemEventProcessor_RootTest.php

示例5: testGetWithChildren

 function testGetWithChildren()
 {
     $tracker = aTracker()->withId(1)->build();
     $dao = new MockTracker_Hierarchy_Dao();
     $children_ids = TestHelper::arrayToDar(array('parent_id' => 1, 'child_id' => 2), array('parent_id' => 1, 'child_id' => 3));
     $dao->setReturnValue('getChildren', $children_ids, array($tracker->getId()));
     $child1 = aTracker()->withId(2)->build();
     $child2 = aTracker()->withId(3)->build();
     $tracker_factory = new MockTrackerFactory();
     $tracker_factory->setReturnValue('getTrackerById', $child1, array(2));
     $tracker_factory->setReturnValue('getTrackerById', $child2, array(3));
     $factory = new Tracker_Hierarchy_HierarchicalTrackerFactory($tracker_factory, $dao);
     $hierarchical_tracker = $factory->getWithChildren($tracker);
     $children = $hierarchical_tracker->getChildren();
     $children = $this->assertChildEquals($children, $child1);
     $children = $this->assertChildEquals($children, $child2);
     $this->assertEqual(count($children), 0);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:18,代码来源:HierarchicalTrackerFactoryTest.php

示例6: GivenAFullApacheConf

 private function GivenAFullApacheConf()
 {
     $backend = TestHelper::getPartialMock('LDAP_BackendSVN', array('_getServiceDao', 'getLdap', 'getLDAPProjectManager', 'getSVNApacheAuthFactory'));
     $project_array_01 = array('unix_group_name' => 'gpig', 'group_name' => 'Guinea Pig', 'group_id' => 101);
     $project_array_02 = array('unix_group_name' => 'garden', 'group_name' => 'The Garden Project', 'group_id' => 102);
     $dar = TestHelper::arrayToDar($project_array_01, $project_array_02);
     $dao = new MockServiceDao();
     $dao->setReturnValue('searchActiveUnixGroupByUsedService', $dar);
     $backend->setReturnValue('_getServiceDao', $dao);
     $ldap = mock('LDAP');
     stub($ldap)->getLDAPParam('server')->returns('ldap://ldap.tuleap.com');
     stub($ldap)->getLDAPParam('dn')->returns('dc=tuleap,dc=com');
     $project_manager = mock('ProjectManager');
     $event_manager = new LDAP_BackendSVNTestEventManager();
     $token_manager = mock('SVN_TokenUsageManager');
     $factory = new SVN_Apache_Auth_Factory($project_manager, $event_manager, $token_manager);
     $backend->setReturnValue('getSVNApacheAuthFactory', $factory);
     return $backend->getApacheConf();
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:19,代码来源:LDAP_BackendSVNTest.php

示例7: itIsNeitherRestrictedNorActive

 public function itIsNeitherRestrictedNorActive()
 {
     $this->user_stub->getStatus()->returns('Not exists');
     $this->user_stub->getProjects()->returns(array());
     $this->user_stub->isMember()->returns(false);
     $this->user_stub->getAllUgroups()->returns(TestHelper::arrayToDar());
     $groups = $this->ugroup_literalizer->getUserGroupsForUserName('john_do');
     $this->assertEqual(array(), $groups);
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:9,代码来源:UGroupLiteralizerTest.php

示例8: itIsNotPossibleToRemoveAllAdminsOfAProject

 function itIsNotPossibleToRemoveAllAdminsOfAProject()
 {
     $ugroup_id = $GLOBALS['UGROUP_PROJECT_ADMIN'];
     $group_id = 300;
     $ugroup = TestHelper::getPartialMock('UGroup', array('_getUserGroupDao'));
     $project_admin_dar = TestHelper::arrayToDar(array('LastAdmin'));
     $dao = stub('UserGroupDao')->returnProjectAdminsByGroupId($group_id)->returns($project_admin_dar);
     stub($ugroup)->_getUserGroupDao()->returns($dao);
     $ugroup->__construct(array('ugroup_id' => $ugroup_id, 'group_id' => $group_id));
     $dao->expectNever('updateUserGroupFlags');
     $this->expectException();
     $ugroup->removeUser($this->user);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:13,代码来源:UGroupTest.php

示例9: testGetFieldFromTrackerAndSharedField

 public function testGetFieldFromTrackerAndSharedField()
 {
     $original_field_dar = TestHelper::arrayToDar($this->createRow(999, 'text'));
     $dao = new MockTracker_FormElement_FieldDao();
     $dao->setReturnValue('searchFieldFromTrackerIdAndSharedFieldId', $original_field_dar, array(66, 123));
     $factory = $this->GivenAFormElementFactory();
     $factory->setReturnValue('getDao', $dao);
     $originalField = aTextField()->withId(999)->build();
     $tracker = aTracker()->withId(66)->build();
     $exportedField = aTextField()->withId(123)->build();
     $this->assertEqual($factory->getFieldFromTrackerAndSharedField($tracker, $exportedField), $originalField);
 }
开发者ID:amanikamail,项目名称:tuleap,代码行数:12,代码来源:Tracker_FormElementFactoryTest.php

示例10: itReturnsNothingIfThereIsNoAssociatedPlanning

 public function itReturnsNothingIfThereIsNoAssociatedPlanning()
 {
     $tracker = aMockTracker()->withId(99)->build();
     $empty_dar = TestHelper::arrayToDar();
     $dao = stub('PlanningDao')->searchByPlanningTrackerId()->returns($empty_dar);
     $factory = aPlanningFactory()->withDao($dao)->build();
     $this->assertNull($factory->getPlanningByPlanningTracker($tracker));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:PlanningFactoryTest.php

示例11: itLoadValueMappingsEvenForStatusField

 public function itLoadValueMappingsEvenForStatusField()
 {
     stub($this->dao)->searchMappingFields($this->tracker->getId())->returns(TestHelper::arrayToDar(array('tracker_id' => 10, 'field_id' => null)));
     stub($this->value_mapping_factory)->getStatusMappings($this->tracker_10, $this->columns)->once();
     $this->factory->getMappings($this->tracker, $this->columns);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:6,代码来源:TrackerMappingFactoryTest.php

示例12: itReturnOnlyPlanningsWhereTheUserCanViewTrackers

 public function itReturnOnlyPlanningsWhereTheUserCanViewTrackers()
 {
     $tracker1 = new MockTracker();
     stub($tracker1)->userCanView($this->user)->returns(true);
     $tracker2 = new MockTracker();
     stub($tracker2)->userCanView($this->user)->returns(false);
     $factoryBuilder = aPlanningFactory();
     $factoryBuilder->tracker_factory->setReturnValue('getTrackerById', $tracker1, array(103));
     $factoryBuilder->tracker_factory->setReturnValue('getTrackerById', $tracker2, array(104));
     $result_set = TestHelper::arrayToDar(array('id' => 1, 'name' => 'Release Backlog', 'group_id' => 102, 'planning_tracker_id' => 103, 'backlog_title' => 'Release Backlog', 'plan_title' => 'Sprint Plan'), array('id' => 2, 'name' => 'Product Backlog', 'group_id' => 102, 'planning_tracker_id' => 104, 'backlog_title' => 'Release Backlog', 'plan_title' => 'Sprint Plan'));
     $factoryBuilder->dao->setReturnValue('searchPlannings', $result_set);
     $expected = array(new Planning(1, 'Release Backlog', 102, 'Release Backlog', 'Sprint Plan'));
     $this->assertEqual($expected, $factoryBuilder->build()->getPlannings($this->user, 123));
 }
开发者ID:nterray,项目名称:tuleap,代码行数:14,代码来源:PlanningFactoryTest.php

示例13: testGetProjectRepositoryListShouldReturnProjectRepositories

 function testGetProjectRepositoryListShouldReturnProjectRepositories()
 {
     $projectId = 42;
     $userId = 24;
     $project_repos = array(array('id' => '1', 'name' => 'a'), array('id' => '2', 'name' => 'b'));
     $sandra_repos = array(array('id' => '3', 'name' => 'c'));
     $repo_owners = TestHelper::arrayToDar(array(array('id' => '123'), array('id' => '456')));
     $dao = new MockGitDao();
     $dao->setReturnValue('getProjectRepositoryList', $project_repos, array($projectId, false, true, null));
     $dao->setReturnValue('getProjectRepositoryList', $sandra_repos, array($projectId, false, true, $userId));
     $dao->setReturnValue('getProjectRepositoriesOwners', $repo_owners, array($projectId));
     $controller = new MockGit();
     $controller->expectAt(0, 'addData', array(array('repository_list' => $project_repos, 'repositories_owners' => $repo_owners)));
     $controller->expectAt(1, 'addData', array(array('repository_list' => $sandra_repos, 'repositories_owners' => $repo_owners)));
     $action = TestHelper::getPartialMock('GitActions', array('getDao'));
     $action->setController($controller);
     $action->setReturnValue('getDao', $dao);
     $action->getProjectRepositoryList($projectId);
     $action->getProjectRepositoryList($projectId, $userId);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:20,代码来源:GitActionsTest.php

示例14: itProvidesTheUserNames

 public function itProvidesTheUserNames()
 {
     $dar = TestHelper::arrayToDar(aUser()->withUserName('Nicolas')->build(), aUser()->withUserName('Johan')->build());
     $users = new Users($dar);
     $this->assertEqual($users->getNames(), array('Nicolas', 'Johan'));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:6,代码来源:UsersTest.php

示例15: itDoesntRemoveTheGerritReservedKeys

 public function itDoesntRemoveTheGerritReservedKeys()
 {
     $this->user_manager->setReturnValueAt(0, 'getUsersWithSshKey', TestHelper::arrayToDar(new PFUser(array('authorized_keys' => $this->key1, 'user_name' => 'john_do'))));
     $this->mass_dumper->dumpSSHKeys();
     $keyfile = 'forge__gerrit_1@0.pub';
     touch($this->_glAdmDir . '/keydir/' . $keyfile);
     $this->gitExec->add($this->_glAdmDir . '/keydir/' . $keyfile);
     $this->gitExec->commit("Gerrit key");
     $this->assertEmptyGitStatus();
     $this->user_manager->setReturnValueAt(1, 'getUsersWithSshKey', TestHelper::emptyDar());
     $this->mass_dumper->dumpSSHKeys();
     $this->assertFalse(is_file($this->_glAdmDir . '/keydir/john_do@0.pub'));
     $this->assertTrue(is_file($this->_glAdmDir . '/keydir/' . $keyfile));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:Git_Gitolite_SSHKeyMassDumperTest.php


注:本文中的TestHelper::arrayToDar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。