fix hook test when not logged in

This commit is contained in:
Robin Appelman 2012-10-07 00:19:35 +02:00
parent 5f462ec6f7
commit 4cdfc72d58
1 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,12 @@ class Test_Filesystem extends UnitTestCase {
}
public function testHooks() {
$user = OC_User::getUser();
if(OC_User::isLoggedIn()){
$user = OC_User::getUser();
}else{
$user=uniqid();
OC_Filesystem::init('/'.$user.'/files');
}
OC_Hook::clear('OC_Filesystem');
OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');