summaryrefslogtreecommitdiffstats
path: root/tests/lib/group
diff options
context:
space:
mode:
authormacjohnny <estebanmarin@gmx.ch>2014-06-24 16:27:38 +0200
committermacjohnny <estebanmarin@gmx.ch>2014-06-24 16:27:38 +0200
commitde53bee9b38a4a757d7b24d7d0e70311e07358b5 (patch)
treed5fa1dae29fb98ec3c521131216e6a53520e6423 /tests/lib/group
parent11ccb57fc7f3048706b001777307ac35d7f0a9db (diff)
downloadnextcloud-server-de53bee9b38a4a757d7b24d7d0e70311e07358b5.tar.gz
nextcloud-server-de53bee9b38a4a757d7b24d7d0e70311e07358b5.zip
adapted tests for a groupId indexed group array
Diffstat (limited to 'tests/lib/group')
-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 6799a598d42..c4a7ede42d3 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());
}
@@ -439,7 +439,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());
}
@@ -480,7 +480,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