summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-02-26 01:48:37 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-26 01:48:37 -0800
commitadc986f3e4b83670f69e2ce48044595193be4e69 (patch)
tree5180b04fd22e0f1735e287e044f737bfb2748abe
parent8a4fddeb4afef2e96cadd505600700202fc0ee9b (diff)
parentfe8df31fa5cb075b4a07108cb7b30bc515d1bb46 (diff)
downloadnextcloud-server-adc986f3e4b83670f69e2ce48044595193be4e69.tar.gz
nextcloud-server-adc986f3e4b83670f69e2ce48044595193be4e69.zip
Merge pull request #14502 from owncloud/failing-mysql-master-tests
Failing mysql master tests
-rw-r--r--apps/files_sharing/tests/controller/sharecontroller.php2
-rw-r--r--apps/files_sharing/tests/testcase.php8
-rw-r--r--apps/provisioning_api/tests/groupstest.php9
-rw-r--r--lib/private/group/manager.php1
-rw-r--r--tests/lib/connector/sabre/objecttree.php1
-rw-r--r--tests/lib/files/objectstore/swift.php2
6 files changed, 17 insertions, 6 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);
}
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php
index 29dc1860891..6b07b2d38c2 100644
--- a/lib/private/group/manager.php
+++ b/lib/private/group/manager.php
@@ -106,6 +106,7 @@ class Manager extends PublicEmitter implements IGroupManager {
public function clearBackends() {
$this->backends = array();
$this->cachedGroups = array();
+ $this->cachedUserGroups = array();
}
/**
diff --git a/tests/lib/connector/sabre/objecttree.php b/tests/lib/connector/sabre/objecttree.php
index 3c972fe6f0f..0709aa89c63 100644
--- a/tests/lib/connector/sabre/objecttree.php
+++ b/tests/lib/connector/sabre/objecttree.php
@@ -11,7 +11,6 @@ namespace Test\OC\Connector\Sabre;
use OC\Files\FileInfo;
use OC\Connector\Sabre\Directory;
-use PHPUnit_Framework_TestCase;
class TestDoubleFileView extends \OC\Files\View {
diff --git a/tests/lib/files/objectstore/swift.php b/tests/lib/files/objectstore/swift.php
index 30c60598277..0aaf7d906dd 100644
--- a/tests/lib/files/objectstore/swift.php
+++ b/tests/lib/files/objectstore/swift.php
@@ -23,8 +23,6 @@ namespace OCA\ObjectStore\Tests\Unit;
use OC\Files\ObjectStore\ObjectStoreStorage;
use OC\Files\ObjectStore\Swift as ObjectStoreToTest;
-use PHPUnit_Framework_TestCase;
-
//class Swift extends PHPUnit_Framework_TestCase {
class Swift extends \Test\Files\Storage\Storage {