summaryrefslogtreecommitdiffstats
path: root/tests/lib/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/cache')
-rw-r--r--tests/lib/cache/file.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/lib/cache/file.php b/tests/lib/cache/file.php
index be2a2a72778..28778efb68c 100644
--- a/tests/lib/cache/file.php
+++ b/tests/lib/cache/file.php
@@ -21,6 +21,8 @@
*/
class Test_Cache_File extends Test_Cache {
+ private $user;
+
function skip() {
//$this->skipUnless(OC_User::isLoggedIn());
}
@@ -39,17 +41,23 @@ class Test_Cache_File extends Test_Cache {
OC_Filesystem::clearMounts();
OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
+ OC_User::clearBackends();
+ OC_User::useBackend(new OC_User_Dummy());
+
//login
- if (OC_User::userExists('test'))
- OC_User::deleteUser('test');
- OC_User::createUser('test', 'testtesttest');
-
- OC_User::login('test', 'testtesttest');
+ OC_User::createUser('test', 'test');
+
+ $this->user=OC_User::getUser();
+ OC_User::setUserId('test');
//set up the users dir
$rootView=new OC_FilesystemView('');
- $rootView->mkdir('/'.OC_User::getUser());
+ $rootView->mkdir('/test');
$this->instance=new OC_Cache_File();
}
+
+ public function tearDown(){
+ OC_User::setUserId($this->user);
+ }
}