Ejemplo n.º 1
0
 public function testGetNodeForPathRoot()
 {
     $path = '/';
     $storage = new Temporary([]);
     $view = $this->getMock('\\OC\\Files\\View', ['resolvePath']);
     $view->expects($this->any())->method('resolvePath')->will($this->returnCallback(function ($path) use($storage) {
         return [$storage, ltrim($path, '/')];
     }));
     $rootNode = $this->getMockBuilder('\\OCA\\DAV\\Connector\\Sabre\\Directory')->disableOriginalConstructor()->getMock();
     $mountManager = $this->getMock('\\OC\\Files\\Mount\\Manager');
     $tree = new \OCA\DAV\Connector\Sabre\ObjectTree();
     $tree->init($rootNode, $view, $mountManager);
     $this->assertInstanceOf('\\Sabre\\DAV\\INode', $tree->getNodeForPath($path));
 }