]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix hook test when not logged in
authorRobin Appelman <icewind@owncloud.com>
Sat, 6 Oct 2012 22:19:35 +0000 (00:19 +0200)
committerRobin Appelman <icewind@owncloud.com>
Sat, 6 Oct 2012 22:19:58 +0000 (00:19 +0200)
tests/lib/filesystem.php

index 4239033551d978f8c518ef9bb26c162bb192aeae..ab5cbe717f28bbe0af2747ba5ec292b4fa0a6960 100644 (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');