/** * This test makes sure that a path like /foo cannot be copied into a path * like /foo/bar/ * * @expectedException \Sabre\DAV\Exception\Conflict */ public function testCopyIntoSubPath() { $dir = new FS\Directory(SABRE_TEMPDIR); $server = new Server($dir); $dir->createDirectory('foo'); $request = new HTTP\Request('COPY', '/foo', ['Destination' => '/foo/bar']); $response = new HTTP\ResponseMock(); $server->invokeMethod($request, $response); }
/** * @depends testTreeMove * @depends testCopyMoveInfo */ function testEverything() { // Request object $serverVars = array('REQUEST_METHOD' => 'MOVE', 'REQUEST_URI' => '/webdav/bar', 'HTTP_DESTINATION' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', 'HTTP_OVERWRITE' => 'F'); $request = new HTTP\Request($serverVars); $request->setBody(''); $response = new HTTP\ResponseMock(); // Server setup mkdir(SABRE_TEMPDIR . '/issue33'); $dir = new FS\Directory(SABRE_TEMPDIR . '/issue33'); $dir->createDirectory('bar'); $tree = new ObjectTree($dir); $server = new Server($tree); $server->setBaseUri('/webdav/'); $server->httpRequest = $request; $server->httpResponse = $response; $server->exec(); $this->assertTrue(file_exists(SABRE_TEMPDIR . '/issue33/' . urldecode('%C3%A0fo%C3%B3'))); }