public function setUp() { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->tree = $this->getMockBuilder('\\Sabre\\DAV\\Tree')->disableOriginalConstructor()->getMock(); $this->plugin = new \OC\Connector\Sabre\FilesPlugin($this->tree); $this->plugin->initialize($this->server); }
public function testGetPublicPermissions() { $this->plugin = new \OC\Connector\Sabre\FilesPlugin($this->tree, $this->view, true); $this->plugin->initialize($this->server); $propFind = new \Sabre\DAV\PropFind('/dummyPath', [self::PERMISSIONS_PROPERTYNAME], 0); $node = $this->createTestNode('\\OC\\Connector\\Sabre\\File'); $node->expects($this->any())->method('getDavPermissions')->will($this->returnValue('DWCKMSR')); $this->plugin->handleGetProperties($propFind, $node); $this->assertEquals('DWCKR', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); }