summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-04-02 10:54:51 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:30 +0200
commit391fab35f078bd37d7b432eaf6a1c6fab701dff4 (patch)
tree3489d28c423bfa52f87dbaa1bb20666d1234587a /apps/files_sharing
parent4c899238e912817a8417c87a7fda26cee84325c7 (diff)
downloadnextcloud-server-391fab35f078bd37d7b432eaf6a1c6fab701dff4.tar.gz
nextcloud-server-391fab35f078bd37d7b432eaf6a1c6fab701dff4.zip
reset storage for each unit test
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/testcase.php13
-rw-r--r--apps/files_sharing/tests/updater.php2
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php
index bef727edac7..69f68f7dfe8 100644
--- a/apps/files_sharing/tests/testcase.php
+++ b/apps/files_sharing/tests/testcase.php
@@ -141,6 +141,8 @@ abstract class TestCase extends \Test\TestCase {
\OC_Group::addToGroup($user, 'group');
}
+ self::resetStorage();
+
\OC_Util::tearDownFS();
\OC::$server->getUserSession()->setUser(null);
\OC\Files\Filesystem::tearDown();
@@ -149,6 +151,17 @@ abstract class TestCase extends \Test\TestCase {
}
/**
+ * reset init status for the share storage
+ */
+ protected static function resetStorage() {
+ $storage = new \ReflectionClass('\OC\Files\Storage\Shared');
+ $isInitialized = $storage->getProperty('isInitialized');
+ $isInitialized->setAccessible(true);
+ $isInitialized->setValue(false);
+ $isInitialized->setAccessible(false);
+ }
+
+ /**
* get some information from a given share
* @param int $shareID
* @return array with: item_source, share_type, share_with, item_type, permissions
diff --git a/apps/files_sharing/tests/updater.php b/apps/files_sharing/tests/updater.php
index df1bbe1cc66..67c76c28ed2 100644
--- a/apps/files_sharing/tests/updater.php
+++ b/apps/files_sharing/tests/updater.php
@@ -27,7 +27,7 @@
/**
* Class Test_Files_Sharing_Updater
*/
-class Test_Files_Sharing_Updater extends OCA\Files_sharing\Tests\TestCase {
+class Test_Files_Sharing_Updater extends OCA\Files_Sharing\Tests\TestCase {
const TEST_FOLDER_NAME = '/folder_share_updater_test';