summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-11-13 23:45:17 +0100
committerBart Visscher <bartv@thisnet.nl>2012-11-13 23:45:17 +0100
commit530f3f8be9336ec49eab9f00e2c3b15d29bc78c7 (patch)
tree4554fda5274e69523269ba938878f48bafdd01bb /tests/lib
parentad85087fccf52ab68899b38b8bab28c0d17b673d (diff)
downloadnextcloud-server-530f3f8be9336ec49eab9f00e2c3b15d29bc78c7.tar.gz
nextcloud-server-530f3f8be9336ec49eab9f00e2c3b15d29bc78c7.zip
Create functions to install standard hooks
Also use these in tests that needs them Fix #151
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/filesystem.php3
-rw-r--r--tests/lib/share/share.php2
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php
index 0008336383e..7b856ef020c 100644
--- a/tests/lib/filesystem.php
+++ b/tests/lib/filesystem.php
@@ -74,8 +74,7 @@ class Test_Filesystem extends UnitTestCase {
public function testBlacklist() {
OC_Hook::clear('OC_Filesystem');
- OC_Hook::connect('OC_Filesystem', 'write', 'OC_Filesystem', 'isBlacklisted');
- OC_Hook::connect('OC_Filesystem', 'rename', 'OC_Filesystem', 'isBlacklisted');
+ OC::installFilesystemHooks();
$run = true;
OC_Hook::emit(
diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php
index 3cdae98ca64..25656c6bcd5 100644
--- a/tests/lib/share/share.php
+++ b/tests/lib/share/share.php
@@ -54,6 +54,8 @@ class Test_Share extends UnitTestCase {
OC_Group::addToGroup($this->user2, $this->group2);
OC_Group::addToGroup($this->user4, $this->group2);
OCP\Share::registerBackend('test', 'Test_Share_Backend');
+ OC_Hook::clear('OCP\\Share');
+ OC::installShareHooks();
}
public function tearDown() {