diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-21 13:17:29 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-05-21 13:17:29 +0200 |
commit | 66f94273c65b6e6b4b41927337467bd3c0aaacc0 (patch) | |
tree | e2ee76de0a947b5a4ad2d6e44da8dbd48d802777 /tests/lib | |
parent | 4fbfe077fb611bea2581556c52c068a3163c73b3 (diff) | |
download | nextcloud-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.php | 16 |
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); |