[Pkg-owncloud-commits] [owncloud] 38/273: clean up created groups after testing, and correct parameter order

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:12:55 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 553c2ad33abc07aff13afa75420a402875b458a4
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Tue Jun 24 21:56:08 2014 +0200

    clean up created groups after testing, and correct parameter order
---
 tests/lib/group/backend.php  | 15 ++++++---------
 tests/lib/group/database.php |  6 ++++--
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tests/lib/group/backend.php b/tests/lib/group/backend.php
index b6e3fa2..34442fa 100644
--- a/tests/lib/group/backend.php
+++ b/tests/lib/group/backend.php
@@ -104,9 +104,9 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase {
 	}
 
 	public function testSearchGroups() {
-		$name1 = 'foobarbaz';
-		$name2 = 'bazbarfoo';
-		$name3 = 'notme';
+		$name1 = $this->getGroupName('foobarbaz');
+		$name2 = $this->getGroupName('bazbarfoo');
+		$name3 = $this->getGroupName('notme');
 
 		$this->backend->createGroup($name1);
 		$this->backend->createGroup($name2);
@@ -114,9 +114,6 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase {
 
 		$result = $this->backend->getGroups('bar');
 		$this->assertSame(2, count($result));
-
-		$result = $this->backend->getDisplayNames('bar');
-		$this->assertSame(2, count($result));
 	}
 
 	public function testSearchUsers() {
@@ -127,9 +124,9 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase {
 		$name2 = 'bazbarfoo';
 		$name3 = 'notme';
 
-		$this->backend->addToGroup($group, $name1);
-		$this->backend->addToGroup($group, $name2);
-		$this->backend->addToGroup($group, $name3);
+		$this->backend->addToGroup($name1, $group);
+		$this->backend->addToGroup($name2, $group);
+		$this->backend->addToGroup($name3, $group);
 
 		$result = $this->backend->usersInGroup($group, 'bar');
 		$this->assertSame(2, count($result));
diff --git a/tests/lib/group/database.php b/tests/lib/group/database.php
index 3e05c65..9b39ac0 100644
--- a/tests/lib/group/database.php
+++ b/tests/lib/group/database.php
@@ -28,8 +28,10 @@ class Test_Group_Database extends Test_Group_Backend {
 	 * test cases can override this in order to clean up created groups
 	 * @return string
 	 */
-	public function getGroupName() {
-		$name=uniqid('test_');
+	public function getGroupName($name = null) {
+		if(is_null($name)) {
+			$name=uniqid('test_');
+		}
 		$this->groups[]=$name;
 		return $name;
 	}

-- 
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