From 0cd4c3410121b9b584dc1b108e555832843b2576 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 15 Feb 2021 18:35:40 +0000 Subject: compser update sabre/dav /vobject --- .../sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php | 354 --------------------- 1 file changed, 354 deletions(-) delete mode 100644 vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php (limited to 'vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php deleted file mode 100644 index 02c6a4633..000000000 --- a/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php +++ /dev/null @@ -1,354 +0,0 @@ - '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(''); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Length' => ['0'], - ], $this->response->getHeaders()); - - $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->getBodyAsString()); - $this->assertTrue(is_dir($this->tempDir.'/testcol')); - } - - /** - * @depends testMkcol - */ - public function testMKCOLUnknownBody() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody('Hello'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(415, $this->response->status); - } - - /** - * @depends testMkcol - */ - public function testMKCOLBrokenXML() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody('Hello'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(400, $this->response->getStatus(), $this->response->getBodyAsString()); - } - - /** - * @depends testMkcol - */ - public function testMKCOLUnknownXML() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(''); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(400, $this->response->getStatus()); - } - - /** - * @depends testMkcol - */ - public function testMKCOLNoResourceType() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(' - - - - Evert - - -'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(400, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMkcol - */ - public function testMKCOLIncorrectResourceType() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(' - - - - - - -'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLIncorrectResourceType - */ - public function testMKCOLSuccess() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(' - - - - - - -'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Length' => ['0'], - ], $this->response->getHeaders()); - - $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLIncorrectResourceType - */ - public function testMKCOLWhiteSpaceResourceType() - { - $serverVars = [ - 'REQUEST_URI' => '/testcol', - 'REQUEST_METHOD' => 'MKCOL', - 'HTTP_CONTENT_TYPE' => 'application/xml', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(' - - - - - - - - -'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Length' => ['0'], - ], $this->response->getHeaders()); - - $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLIncorrectResourceType - */ - public function testMKCOLNoParent() - { - $serverVars = [ - 'REQUEST_URI' => '/testnoparent/409me', - 'REQUEST_METHOD' => 'MKCOL', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(''); - - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLIncorrectResourceType - */ - public function testMKCOLParentIsNoCollection() - { - $serverVars = [ - 'REQUEST_URI' => '/test.txt/409me', - 'REQUEST_METHOD' => 'MKCOL', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(''); - - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLIncorrectResourceType - */ - public function testMKCOLAlreadyExists() - { - $serverVars = [ - 'REQUEST_URI' => '/test.txt', - 'REQUEST_METHOD' => 'MKCOL', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); - $request->setBody(''); - - $this->server->httpRequest = ($request); - $this->server->exec(); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - 'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT'], - ], $this->response->getHeaders()); - - $this->assertEquals(405, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); - } - - /** - * @depends testMKCOLSuccess - * @depends testMKCOLAlreadyExists - */ - public function testMKCOLAndProps() - { - $request = new HTTP\Request( - 'MKCOL', - '/testcol', - ['Content-Type' => 'application/xml'] - ); - $request->setBody(' - - - - - my new collection - - -'); - $this->server->httpRequest = ($request); - $this->server->exec(); - - $bodyAsString = $this->response->getBodyAsString(); - $this->assertEquals(207, $this->response->status, 'Wrong statuscode received. Full response body: '.$bodyAsString); - - $this->assertEquals([ - 'X-Sabre-Version' => [Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ], $this->response->getHeaders()); - - $expected = << - - - /testcol - - - - - HTTP/1.1 403 Forbidden - - - -XML; - - $this->assertXmlStringEqualsXmlString( - $expected, - $bodyAsString - ); - } -} -- cgit v1.2.3