summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-01-03 22:41:44 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-01-03 22:41:44 +0100
commitfcae87170d92e3a510d25be41d8c80546053abe6 (patch)
tree7f556306eb11f8f264cc565b64d74035da812455 /apps/provisioning_api/tests
parent92f062baac041f0be8a717a6224efbdb95f61b1a (diff)
parenta20de1548d5eaa7298a18c223d53c6484d5f96ac (diff)
downloadnextcloud-server-fcae87170d92e3a510d25be41d8c80546053abe6.tar.gz
nextcloud-server-fcae87170d92e3a510d25be41d8c80546053abe6.zip
Merge pull request #13091 from owncloud/fix-provisioning-api
Fix remaining unit tests for provisioning_api
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r--apps/provisioning_api/tests/AppsTest.php7
-rw-r--r--apps/provisioning_api/tests/groupsTest.php8
-rw-r--r--apps/provisioning_api/tests/usersTest.php6
3 files changed, 18 insertions, 3 deletions
diff --git a/apps/provisioning_api/tests/AppsTest.php b/apps/provisioning_api/tests/AppsTest.php
index 2a269450ccd..c68259d1756 100644
--- a/apps/provisioning_api/tests/AppsTest.php
+++ b/apps/provisioning_api/tests/AppsTest.php
@@ -27,6 +27,9 @@ class Test_Provisioning_Api_Apps extends PHPUnit_Framework_TestCase {
private $users = array();
+ function setUp() {
+ OC_Group::createGroup('admin');
+ }
/**
* Generates a temp user
* @param $num int number of users to generate
@@ -98,4 +101,8 @@ class Test_Provisioning_Api_Apps extends PHPUnit_Framework_TestCase {
}
+ function tearDown() {
+ OC_Group::deleteGroup('admin');
+ }
+
}
diff --git a/apps/provisioning_api/tests/groupsTest.php b/apps/provisioning_api/tests/groupsTest.php
index 0fb6e18a3eb..280e4792ff7 100644
--- a/apps/provisioning_api/tests/groupsTest.php
+++ b/apps/provisioning_api/tests/groupsTest.php
@@ -27,6 +27,11 @@ class Test_Provisioning_Api_Groups extends PHPUnit_Framework_TestCase {
private $users = array();
+ public function setUp() {
+ // These seems to be deleted by another test.
+ OC_Group::createGroup('admin');
+ }
+
/**
* Generates a temp user
* @param $num int number of users to generate
@@ -145,10 +150,8 @@ class Test_Provisioning_Api_Groups extends PHPUnit_Framework_TestCase {
OC_Group::deleteGroup($group1);
$user1 = $this->generateUsers();
- $user2 = $this->generateUsers();
OC_User::setUserId($user1);
OC_Group::addToGroup($user1, 'admin');
- $group1 = uniqid();
$result = \OCA\provisioning_api\Groups::getSubAdminsOfGroup(array(
'groupid' => uniqid(),
));
@@ -164,6 +167,7 @@ class Test_Provisioning_Api_Groups extends PHPUnit_Framework_TestCase {
foreach($this->users as $user) {
\OC_User::deleteUser($user);
}
+ OC_Group::deleteGroup('admin');
}
diff --git a/apps/provisioning_api/tests/usersTest.php b/apps/provisioning_api/tests/usersTest.php
index b464a2e5fd0..381baa633e4 100644
--- a/apps/provisioning_api/tests/usersTest.php
+++ b/apps/provisioning_api/tests/usersTest.php
@@ -26,6 +26,10 @@ class Test_Provisioning_Api_Users extends PHPUnit_Framework_TestCase {
private $users = array();
+ public function setUp() {
+ OC_Group::createGroup('admin');
+ }
+
/**
* Generates a temp user
* @param $num int number of users to generate
@@ -436,7 +440,6 @@ class Test_Provisioning_Api_Users extends PHPUnit_Framework_TestCase {
));
$this->assertInstanceOf('OC_OCS_Result', $result);
$this->assertFalse($result->succeeded());
- $data = $result->getData();
OC_Group::deleteGroup($group);
}
@@ -790,6 +793,7 @@ class Test_Provisioning_Api_Users extends PHPUnit_Framework_TestCase {
foreach($this->users as $user) {
\OC_User::deleteUser($user);
}
+ OC_Group::deleteGroup('admin');
}
}