summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormacjohnny <estebanmarin@gmx.ch>2014-06-19 11:37:46 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-10-17 21:14:01 +0200
commit174ab07a4beed45b2d3a477723f6b47a37ecc7ce (patch)
tree7c51aa09e660f5eb52acea978eca5641a0ee5bab /tests
parent9998861402d9b16e2e7d8ebd9382633fc91a5dae (diff)
downloadnextcloud-server-174ab07a4beed45b2d3a477723f6b47a37ecc7ce.tar.gz
nextcloud-server-174ab07a4beed45b2d3a477723f6b47a37ecc7ce.zip
backport of #9104
Update manager.php add caching to getUserGroupIds Update manager.php added description and blank lines in getUserGroupIds Update manager.php defined $uid in getUserGroupIds Update manager.php Update manager.php Update manager.php clean up function getUserGroupIds clean up of function getUserGroupIds and improved caching mechanism of cachedUserGroupIds modified caching mechanism in getUserGroupIds removed cachedUserGroupIds, instead changed indexing in getUserGroups to groupId adapted tests for a groupId indexed group array
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/group/manager.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/group/manager.php b/tests/lib/group/manager.php
index 70d9783946a..e4b3a522767 100644
--- a/tests/lib/group/manager.php
+++ b/tests/lib/group/manager.php
@@ -190,7 +190,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$groups = $manager->search('1');
$this->assertEquals(1, count($groups));
- $group1 = $groups[0];
+ $group1 = reset($groups);
$this->assertEquals('group1', $group1->getGID());
}
@@ -229,8 +229,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
$groups = $manager->search('1');
$this->assertEquals(2, count($groups));
- $group1 = $groups[0];
- $group12 = $groups[1];
+ $group1 = reset($groups);
+ $group12 = next($groups);
$this->assertEquals('group1', $group1->getGID());
$this->assertEquals('group12', $group12->getGID());
}
@@ -270,8 +270,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
$groups = $manager->search('1', 2, 1);
$this->assertEquals(2, count($groups));
- $group1 = $groups[0];
- $group12 = $groups[1];
+ $group1 = reset($groups);
+ $group12 = next($groups);
$this->assertEquals('group1', $group1->getGID());
$this->assertEquals('group12', $group12->getGID());
}
@@ -300,7 +300,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$groups = $manager->getUserGroups(new User('user1', $userBackend));
$this->assertEquals(1, count($groups));
- $group1 = $groups[0];
+ $group1 = reset($groups);
$this->assertEquals('group1', $group1->getGID());
}
@@ -340,8 +340,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
$groups = $manager->getUserGroups(new User('user1', $userBackend));
$this->assertEquals(2, count($groups));
- $group1 = $groups[0];
- $group2 = $groups[1];
+ $group1 = reset($groups);
+ $group2 = next($groups);
$this->assertEquals('group1', $group1->getGID());
$this->assertEquals('group2', $group2->getGID());
}
@@ -727,7 +727,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
// check result
$groups = $manager->getUserGroups($user1);
$this->assertEquals(1, count($groups));
- $group1 = $groups[0];
+ $group1 = reset($groups);
$this->assertEquals('group1', $group1->getGID());
}
@@ -768,7 +768,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$user1 = new User('user1', null);
$groups = $manager->getUserGroups($user1);
$this->assertEquals(1, count($groups));
- $group1 = $groups[0];
+ $group1 = reset($groups);
$this->assertEquals('group1', $group1->getGID());
// remove user