diff options
Diffstat (limited to 'apps/files_sharing/tests/testcase.php')
-rw-r--r-- | apps/files_sharing/tests/testcase.php | 13 |
1 files changed, 13 insertions, 0 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 |