[Pkg-owncloud-commits] [owncloud] 103/153: Add a lot of users for testing

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:43 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 66f94273c65b6e6b4b41927337467bd3c0aaacc0
Author: Joas Schilling <nickvergessen at gmx.de>
Date:   Wed May 21 13:17:29 2014 +0200

    Add a lot of users for testing
---
 tests/lib/preferences.php | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/lib/preferences.php b/tests/lib/preferences.php
index 2f15f47..96228fc 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list