From: Robin Appelman Date: Sat, 6 Oct 2012 22:19:35 +0000 (+0200) Subject: fix hook test when not logged in X-Git-Tag: v4.5.0RC3~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cdfc72d58ff17cfc468b9474b7c480952ee7412;p=nextcloud-server.git fix hook test when not logged in --- diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php index 4239033551d..ab5cbe717f2 100644 --- a/tests/lib/filesystem.php +++ b/tests/lib/filesystem.php @@ -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');