summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-05-21 13:17:29 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-05-21 13:17:29 +0200
commit66f94273c65b6e6b4b41927337467bd3c0aaacc0 (patch)
treee2ee76de0a947b5a4ad2d6e44da8dbd48d802777 /tests/lib
parent4fbfe077fb611bea2581556c52c068a3163c73b3 (diff)
downloadnextcloud-server-66f94273c65b6e6b4b41927337467bd3c0aaacc0.tar.gz
nextcloud-server-66f94273c65b6e6b4b41927337467bd3c0aaacc0.zip
Add a lot of users for testing
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/preferences.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php
index 2f15f47ea14..96228fcca15 100644
--- a/tests/lib/preferences.php
+++ b/tests/lib/preferences.php
@@ -192,8 +192,22 @@ class Test_Preferences_Object extends PHPUnit_Framework_TestCase {
$query->execute(array('AUser', 'testGetUserValues', 'somekey', 'somevalue'));
$preferences = new OC\Preferences(\OC_DB::getConnection());
- $values = $preferences->getValueForUsers('testGetUserValues', 'somekey', array('SomeUser', 'AnotherUser', 'NoValueSet'));
+ $users = array('SomeUser', 'AnotherUser', 'NoValueSet');
+ $values = $preferences->getValueForUsers('testGetUserValues', 'somekey', $users);
+ $this->assertUserValues($values);
+
+ // Add a lot of users so the array is chunked
+ for ($i = 1; $i <= 75; $i++) {
+ array_unshift($users, 'NoValueBefore#' . $i);
+ array_push($users, 'NoValueAfter#' . $i);
+ }
+
+ $values = $preferences->getValueForUsers('testGetUserValues', 'somekey', $users);
+ $this->assertUserValues($values);
+ }
+
+ protected function assertUserValues($values) {
$this->assertEquals(2, sizeof($values));
$this->assertArrayHasKey('SomeUser', $values);