diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-04-08 12:03:55 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-04-08 12:45:38 +0200 |
commit | f8cfc03f36e438f1874e9840ce69811112e15475 (patch) | |
tree | 4b09a8e57c2c1492ee023e2adf9efa2a9acc709e /tests/lib/files/cache/updater.php | |
parent | 6c327f8331617652ef0b268d51edc6a23624e33c (diff) | |
download | nextcloud-server-f8cfc03f36e438f1874e9840ce69811112e15475.tar.gz nextcloud-server-f8cfc03f36e438f1874e9840ce69811112e15475.zip |
Replace originalStorage in tests with a proper teardown
The purpose of $originalStorage in unit tests was to remount the old
root.
However that storage itself is already wrapped by storage wrapper, so
remounting it would rewrap the storage several times.
This fix makes use of "loginAsUser()" and "logout()" from the TestCase
class to properly initialize and cleanup the FS as expected.
Diffstat (limited to 'tests/lib/files/cache/updater.php')
-rw-r--r-- | tests/lib/files/cache/updater.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index 970af2e68df..7c3ebd5a6f9 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -33,16 +33,12 @@ class Updater extends \Test\TestCase { */ protected $updater; - /** @var \OC\Files\Storage\Storage */ - private $originalStorage; - protected function setUp() { parent::setUp(); - $this->originalStorage = Filesystem::getStorage('/'); + $this->loginAsUser(); $this->storage = new Temporary(array()); - Filesystem::clearMounts(); Filesystem::mount($this->storage, array(), '/'); $this->view = new View(''); $this->updater = new \OC\Files\Cache\Updater($this->view); @@ -51,8 +47,8 @@ class Updater extends \Test\TestCase { protected function tearDown() { Filesystem::clearMounts(); - Filesystem::mount($this->originalStorage, array(), '/'); + $this->logout(); parent::tearDown(); } |