diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-07-23 22:32:07 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-07-23 22:32:07 +0200 |
commit | 59364366d8c69ca217fb817535d1b5d1df316841 (patch) | |
tree | 17b72a0118baad1610e23521864175cf3a1e4fa2 /tests | |
parent | e49666d36bdd10c02144878e83a6cdefd4342256 (diff) | |
download | nextcloud-server-59364366d8c69ca217fb817535d1b5d1df316841.tar.gz nextcloud-server-59364366d8c69ca217fb817535d1b5d1df316841.zip |
use dummy user backend for oc_cache_file tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/cache/file.php | 20 |
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); + } } |