use dummy user backend for oc_cache_file tests
This commit is contained in:
parent
e49666d36b
commit
59364366d8
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Test_Cache_File extends Test_Cache {
|
class Test_Cache_File extends Test_Cache {
|
||||||
|
private $user;
|
||||||
|
|
||||||
function skip() {
|
function skip() {
|
||||||
//$this->skipUnless(OC_User::isLoggedIn());
|
//$this->skipUnless(OC_User::isLoggedIn());
|
||||||
}
|
}
|
||||||
|
@ -39,17 +41,23 @@ class Test_Cache_File extends Test_Cache {
|
||||||
OC_Filesystem::clearMounts();
|
OC_Filesystem::clearMounts();
|
||||||
OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
|
OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
|
||||||
|
|
||||||
//login
|
OC_User::clearBackends();
|
||||||
if (OC_User::userExists('test'))
|
OC_User::useBackend(new OC_User_Dummy());
|
||||||
OC_User::deleteUser('test');
|
|
||||||
OC_User::createUser('test', 'testtesttest');
|
|
||||||
|
|
||||||
OC_User::login('test', 'testtesttest');
|
//login
|
||||||
|
OC_User::createUser('test', 'test');
|
||||||
|
|
||||||
|
$this->user=OC_User::getUser();
|
||||||
|
OC_User::setUserId('test');
|
||||||
|
|
||||||
//set up the users dir
|
//set up the users dir
|
||||||
$rootView=new OC_FilesystemView('');
|
$rootView=new OC_FilesystemView('');
|
||||||
$rootView->mkdir('/'.OC_User::getUser());
|
$rootView->mkdir('/test');
|
||||||
|
|
||||||
$this->instance=new OC_Cache_File();
|
$this->instance=new OC_Cache_File();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tearDown(){
|
||||||
|
OC_User::setUserId($this->user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue