]> source.dussan.org Git - nextcloud-server.git/commitdiff
reset storage for each unit test
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 2 Apr 2015 08:54:51 +0000 (10:54 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:30 +0000 (13:30 +0200)
apps/files_sharing/tests/testcase.php
apps/files_sharing/tests/updater.php

index bef727edac780ce667878db8874081b28257f682..69f68f7dfe8694e2124edf45373c872cf5ec84b7 100644 (file)
@@ -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();
@@ -148,6 +150,17 @@ abstract class TestCase extends \Test\TestCase {
                \OC_Util::setupFS($user);
        }
 
+       /**
+        * 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
index df1bbe1cc66df1ab8308b83d90ab7f0a236c0e86..67c76c28ed2fe9ee2a96322cd1ef92748445536a 100644 (file)
@@ -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';