diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/tests/controller/sharecontroller.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/testcase.php | 8 | ||||
-rw-r--r-- | apps/provisioning_api/tests/groupstest.php | 9 |
3 files changed, 16 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php index 95f5abcc9bd..da628b03757 100644 --- a/apps/files_sharing/tests/controller/sharecontroller.php +++ b/apps/files_sharing/tests/controller/sharecontroller.php @@ -36,7 +36,7 @@ use OC\URLGenerator; /** * @package OCA\Files_Sharing\Controllers */ -class ShareControllerTest extends \PHPUnit_Framework_TestCase { +class ShareControllerTest extends \Test\TestCase { /** @var IAppContainer */ private $container; diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php index cbf324df55d..3c4b5870efa 100644 --- a/apps/files_sharing/tests/testcase.php +++ b/apps/files_sharing/tests/testcase.php @@ -65,7 +65,7 @@ abstract class TestCase extends \Test\TestCase { // reset backend \OC_User::clearBackends(); - \OC_User::useBackend('database'); + \OC_Group::clearBackends(); // clear share hooks \OC_Hook::clear('OCP\\Share'); @@ -130,6 +130,12 @@ abstract class TestCase extends \Test\TestCase { \OC_User::setUserId(''); Filesystem::tearDown(); + // reset backend + \OC_User::clearBackends(); + \OC_User::useBackend('database'); + \OC_Group::clearBackends(); + \OC_Group::useBackend(new \OC_Group_Database()); + parent::tearDownAfterClass(); } diff --git a/apps/provisioning_api/tests/groupstest.php b/apps/provisioning_api/tests/groupstest.php index 7b6e1333c2a..3ce05b97ae7 100644 --- a/apps/provisioning_api/tests/groupstest.php +++ b/apps/provisioning_api/tests/groupstest.php @@ -59,7 +59,14 @@ class GroupsTest extends TestCase { $this->assertInstanceOf('OC_OCS_Result', $result); $this->assertTrue($result->succeeded()); - $this->assertEquals(array('users' => $users), $result->getData()); + $this->assertEquals(1, sizeof($result->getData()), 'Asserting the result data array only has the "users" key'); + $this->assertArrayHasKey('users', $result->getData()); + $resultData = $result->getData(); + $resultData = $resultData['users']; + + sort($users); + sort($resultData); + $this->assertEquals($users, $resultData); } |