|
@@ -16,16 +16,11 @@ class EtagTest extends \Test\TestCase {
|
|
|
|
|
|
private $tmpDir;
|
|
|
|
|
|
- private $uid;
|
|
|
-
|
|
|
/**
|
|
|
* @var \OC_User_Dummy $userBackend
|
|
|
*/
|
|
|
private $userBackend;
|
|
|
|
|
|
- /** @var \OC\Files\Storage\Storage */
|
|
|
- private $originalStorage;
|
|
|
-
|
|
|
protected function setUp() {
|
|
|
parent::setUp();
|
|
|
|
|
@@ -37,21 +32,15 @@ class EtagTest extends \Test\TestCase {
|
|
|
$this->datadir = \OC_Config::getValue('datadirectory');
|
|
|
$this->tmpDir = \OC_Helper::tmpFolder();
|
|
|
\OC_Config::setValue('datadirectory', $this->tmpDir);
|
|
|
- $this->uid = \OC_User::getUser();
|
|
|
- \OC_User::setUserId(null);
|
|
|
|
|
|
$this->userBackend = new \OC_User_Dummy();
|
|
|
\OC_User::useBackend($this->userBackend);
|
|
|
- $this->originalStorage = \OC\Files\Filesystem::getStorage('/');
|
|
|
- \OC_Util::tearDownFS();
|
|
|
}
|
|
|
|
|
|
protected function tearDown() {
|
|
|
\OC_Config::setValue('datadirectory', $this->datadir);
|
|
|
- \OC_User::setUserId($this->uid);
|
|
|
- \OC_Util::setupFS($this->uid);
|
|
|
- \OC\Files\Filesystem::mount($this->originalStorage, array(), '/');
|
|
|
|
|
|
+ $this->logout();
|
|
|
parent::tearDown();
|
|
|
}
|
|
|
|
|
@@ -59,9 +48,7 @@ class EtagTest extends \Test\TestCase {
|
|
|
$user1 = $this->getUniqueID('user_');
|
|
|
$this->userBackend->createUser($user1, '');
|
|
|
|
|
|
- \OC_Util::tearDownFS();
|
|
|
- \OC_User::setUserId($user1);
|
|
|
- \OC_Util::setupFS($user1);
|
|
|
+ $this->loginAsUser($user1);
|
|
|
Filesystem::mkdir('/folder');
|
|
|
Filesystem::mkdir('/folder/subfolder');
|
|
|
Filesystem::file_put_contents('/foo.txt', 'asd');
|