summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-07 00:19:35 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-07 00:19:58 +0200
commit4cdfc72d58ff17cfc468b9474b7c480952ee7412 (patch)
tree63e090999ec710ed7a77ab3b4451fe74338779a2
parent5f462ec6f71b82ec334aeef402d98ed7207dcbd7 (diff)
downloadnextcloud-server-4cdfc72d58ff17cfc468b9474b7c480952ee7412.tar.gz
nextcloud-server-4cdfc72d58ff17cfc468b9474b7c480952ee7412.zip
fix hook test when not logged in
-rw-r--r--tests/lib/filesystem.php7
1 files changed, 6 insertions, 1 deletions
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');