use dummy user backend for oc_cache_file tests

remotes/origin/stable45
Robin Appelman 13 years ago
parent e49666d36b
commit 59364366d8
  1. 20
      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);
}
}

Loading…
Cancel
Save