diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-10-10 11:34:30 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-10-10 11:34:30 +0200 |
commit | 1378af838ced159f1070f869394dccbde8c21219 (patch) | |
tree | 7c6b43f7900000a2400a6ad2368f3f54d7075cc7 /tests | |
parent | 7f8eeb04747e88770a9eb49dffa028a36ab6cadc (diff) | |
parent | 1cb47bf777bea9f46a9554ea1b570bfc9ec69845 (diff) | |
download | nextcloud-server-1378af838ced159f1070f869394dccbde8c21219.tar.gz nextcloud-server-1378af838ced159f1070f869394dccbde8c21219.zip |
merge master into hooks-view-same-start
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/view.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index e2107a03614..b2dd3963f1c 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -392,6 +392,12 @@ class View extends \PHPUnit_Framework_TestCase { return $storage; } + private $createHookPath; + + function dummyCreateHook($params) { + $this->createHookPath = $params['path']; + } + /** * @medium */ @@ -409,4 +415,23 @@ class View extends \PHPUnit_Framework_TestCase { $subView->file_put_contents('/foo.txt', 'asd'); $this->assertNull($this->hookPath); } + + public function testEditNoCreateHook() { + $storage1 = $this->getTestStorage(); + $storage2 = $this->getTestStorage(); + $defaultRoot = \OC\Files\Filesystem::getRoot(); + \OC\Files\Filesystem::mount($storage1, array(), '/'); + \OC\Files\Filesystem::mount($storage2, array(), $defaultRoot); + \OC_Hook::connect('OC_Filesystem', 'post_create', $this, 'dummyCreateHook'); + + $view = new \OC\Files\View($defaultRoot); + $this->hookPath = null; + + $view->file_put_contents('/asd.txt', 'foo'); + $this->assertEquals('/asd.txt', $this->createHookPath); + $this->createHookPath = null; + + $view->file_put_contents('/asd.txt', 'foo'); + $this->assertNull($this->createHookPath); + } } |