public function testPostDeleteMeta()
 {
     $connector = new \OC\Files\Node\HookConnector($this->root, $this->view);
     $connector->viewToNode();
     $hookCalled = false;
     /** @var Node $hookNode */
     $hookNode = null;
     $this->root->listen('\\OC\\Files', 'postDelete', function ($node) use(&$hookNode, &$hookCalled) {
         $hookCalled = true;
         $hookNode = $node;
     });
     Filesystem::file_put_contents('test.txt', 'asd');
     $info = Filesystem::getFileInfo('test.txt');
     Filesystem::unlink('test.txt');
     $this->assertTrue($hookCalled);
     $this->assertEquals($hookNode->getId(), $info->getId());
 }
 /**
  * @param callable $operation
  * @param string $expectedHook
  * @dataProvider viewToNodeProviderCopyRename
  */
 public function testViewToNodeCopyRename(callable $operation, $expectedHook)
 {
     $connector = new \OC\Files\Node\HookConnector($this->root, $this->view);
     $connector->viewToNode();
     $hookCalled = false;
     /** @var Node $hookSourceNode */
     $hookSourceNode = null;
     /** @var Node $hookTargetNode */
     $hookTargetNode = null;
     $this->root->listen('\\OC\\Files', $expectedHook, function ($sourceNode, $targetNode) use(&$hookCalled, &$hookSourceNode, &$hookTargetNode) {
         $hookCalled = true;
         $hookSourceNode = $sourceNode;
         $hookTargetNode = $targetNode;
     });
     $operation();
     $this->assertTrue($hookCalled);
     $this->assertEquals('/' . $this->userId . '/files/source', $hookSourceNode->getPath());
     $this->assertEquals('/' . $this->userId . '/files/target', $hookTargetNode->getPath());
 }