diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV')
13 files changed, 68 insertions, 67 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php index 5f5d666f9..bf1e22aea 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php @@ -9,7 +9,7 @@ use Sabre\HTTP; abstract class AbstractServer extends \PHPUnit\Framework\TestCase { /** - * @var Sabre\HTTP\ResponseMock + * @var \Sabre\HTTP\ResponseMock */ protected $response; protected $request; diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php index de7b85f32..f51f5546c 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php @@ -29,7 +29,7 @@ class MapGetToPropFindTest extends DAV\AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: '.$this->response->body); + $this->assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: '.$this->response->getBodyAsString()); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Type' => ['application/xml; charset=utf-8'], diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php index fb7c63d46..f28661ca7 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Browser/PluginTest.php @@ -148,7 +148,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(200, $this->response->getStatus(), 'Error: '.$this->response->body); + $this->assertEquals(200, $this->response->getStatus(), 'Error: '.$this->response->getBodyAsString()); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Type' => ['image/vnd.microsoft.icon'], @@ -164,7 +164,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->body); + $this->assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->getBodyAsString()); } public function testGetAssetEscapeBasePath() @@ -173,6 +173,6 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->body); + $this->assertEquals(404, $this->response->getStatus(), 'Error: '.$this->response->getBodyAsString()); } } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php index daa04c354..f53807e6c 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/FSExt/ServerTest.php @@ -34,7 +34,7 @@ class ServerTest extends DAV\AbstractServer $this->response->getHeaders() ); - $this->assertEquals('Test contents', stream_get_contents($this->response->body)); + $this->assertEquals('Test contents', $this->response->getBodyAsString()); } public function testHEAD() @@ -55,7 +55,7 @@ class ServerTest extends DAV\AbstractServer ); $this->assertEquals(200, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); } public function testPut() @@ -73,7 +73,7 @@ class ServerTest extends DAV\AbstractServer ], $this->response->getHeaders()); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals('Testing new file', file_get_contents($filename)); } @@ -105,7 +105,7 @@ class ServerTest extends DAV\AbstractServer ], $this->response->getHeaders()); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertTrue(is_dir($this->tempDir.'/testcol')); } @@ -119,7 +119,7 @@ class ServerTest extends DAV\AbstractServer $this->assertEquals('0', $this->response->getHeader('Content-Length')); $this->assertEquals(204, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals('Testing updated file', file_get_contents($this->tempDir.'/test.txt')); } @@ -135,7 +135,7 @@ class ServerTest extends DAV\AbstractServer ], $this->response->getHeaders()); $this->assertEquals(204, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertFalse(file_exists($this->tempDir.'/test.txt')); } @@ -153,7 +153,7 @@ class ServerTest extends DAV\AbstractServer 'Content-Length' => ['0'], ], $this->response->getHeaders()); $this->assertEquals(204, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertFalse(file_exists($this->tempDir.'/testcol')); } @@ -173,7 +173,7 @@ class ServerTest extends DAV\AbstractServer ], $this->response->getHeaders()); $this->assertEquals(200, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); } public function testMove() @@ -185,7 +185,7 @@ class ServerTest extends DAV\AbstractServer $this->server->exec(); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals([ 'Content-Length' => ['0'], @@ -220,7 +220,7 @@ class ServerTest extends DAV\AbstractServer $this->server->exec(); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals([ 'Content-Length' => ['0'], @@ -241,7 +241,7 @@ class ServerTest extends DAV\AbstractServer $this->server->exec(); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals([ 'Content-Length' => ['0'], diff --git a/vendor/sabre/dav/tests/Sabre/DAV/HTTPPreferParsingTest.php b/vendor/sabre/dav/tests/Sabre/DAV/HTTPPreferParsingTest.php index d0ff77eb4..7d6825612 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/HTTPPreferParsingTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/HTTPPreferParsingTest.php @@ -145,7 +145,7 @@ BLA $response = $this->request($request); - $this->assertEquals('', $response->getBodyAsString(), 'Expected empty body: '.$response->body); + $this->assertEquals('', $response->getBodyAsString(), 'Expected empty body: '.$response->getBodyAsString()); $this->assertEquals(204, $response->status); } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php index b3a0ac9af..a9c6cc1bc 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php @@ -77,9 +77,9 @@ class PluginTest extends DAV\AbstractServer $this->assertEquals('application/xml; charset=utf-8', $this->response->getHeader('Content-Type')); $this->assertTrue(1 === preg_match('/^<opaquelocktoken:(.*)>$/', $this->response->getHeader('Lock-Token')), 'We did not get a valid Locktoken back ('.$this->response->getHeader('Lock-Token').')'); - $this->assertEquals(200, $this->response->status, 'Got an incorrect status back. Response body: '.$this->response->body); + $this->assertEquals(200, $this->response->status, 'Got an incorrect status back. Response body: '.$this->response->getBodyAsString()); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -102,7 +102,7 @@ class PluginTest extends DAV\AbstractServer foreach ($elements as $elem) { $data = $xml->xpath($elem); - $this->assertEquals(1, count($data), 'We expected 1 match for the xpath expression "'.$elem.'". '.count($data).' were found. Full response body: '.$this->response->body); + $this->assertEquals(1, count($data), 'We expected 1 match for the xpath expression "'.$elem.'". '.count($data).' were found. Full response body: '.$this->response->getBodyAsString()); } $depth = $xml->xpath('/d:prop/d:lockdiscovery/d:activelock/d:depth'); @@ -137,7 +137,7 @@ class PluginTest extends DAV\AbstractServer $this->assertEquals('application/xml; charset=utf-8', $this->response->getHeader('Content-Type')); - $this->assertEquals(423, $this->response->status, 'Full response: '.$this->response->body); + $this->assertEquals(423, $this->response->status, 'Full response: '.$this->response->getBodyAsString()); } /** @@ -267,7 +267,7 @@ class PluginTest extends DAV\AbstractServer $this->response->getHeaders() ); - $this->assertEquals(409, $this->response->status, 'Got an incorrect status code. Full response body: '.$this->response->body); + $this->assertEquals(409, $this->response->status, 'Got an incorrect status code. Full response body: '.$this->response->getBodyAsString()); } /** @@ -329,7 +329,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpResponse = new HTTP\ResponseMock(); $this->server->invokeMethod($request, $this->server->httpResponse); - $this->assertEquals(204, $this->server->httpResponse->status, 'Got an incorrect status code. Full response body: '.$this->response->body); + $this->assertEquals(204, $this->server->httpResponse->status, 'Got an incorrect status code. Full response body: '.$this->response->getBodyAsString()); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Length' => ['0'], @@ -366,7 +366,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpResponse = new HTTP\ResponseMock(); $this->server->invokeMethod($request, $this->server->httpResponse); - $this->assertEquals(204, $this->server->httpResponse->status, 'Got an incorrect status code. Full response body: '.$this->response->body); + $this->assertEquals(204, $this->server->httpResponse->status, 'Got an incorrect status code. Full response body: '.$this->response->getBodyAsString()); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Length' => ['0'], @@ -629,7 +629,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(201, $this->response->status, 'A valid lock-token was provided for the source, so this MOVE operation must succeed. Full response body: '.$this->response->body); + $this->assertEquals(201, $this->response->status, 'A valid lock-token was provided for the source, so this MOVE operation must succeed. Full response body: '.$this->response->getBodyAsString()); } /** @@ -809,7 +809,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(204, $this->response->status, 'Incorrect status received. Full response body:'.$this->response->body); + $this->assertEquals(204, $this->response->status, 'Incorrect status received. Full response body:'.$this->response->getBodyAsString()); } public function testDeleteWithETagOnCollection() diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php index c993e609d..0e3123b35 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php @@ -28,7 +28,7 @@ class PluginTest extends DAV\AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals(501, $this->response->status, 'We expected GET to not be implemented for Directories. Response body: '.$this->response->body); + $this->assertEquals(501, $this->response->status, 'We expected GET to not be implemented for Directories. Response body: '.$this->response->getBodyAsString()); } public function testMountResponse() @@ -46,8 +46,8 @@ class PluginTest extends DAV\AbstractServer $this->assertEquals(200, $this->response->status); - $xml = simplexml_load_string($this->response->body); - $this->assertInstanceOf('SimpleXMLElement', $xml, 'Response was not a valid xml document. The list of errors:'.print_r(libxml_get_errors(), true).'. xml body: '.$this->response->body.'. What type we got: '.gettype($xml).' class, if object: '.get_class($xml)); + $xml = simplexml_load_string($this->response->getBodyAsString()); + $this->assertInstanceOf('SimpleXMLElement', $xml, 'Response was not a valid xml document. The list of errors:'.print_r(libxml_get_errors(), true).'. xml body: '.$this->response->getBodyAsString().'. What type we got: '.gettype($xml).' class, if object: '.get_class($xml)); $xml->registerXPathNamespace('dm', 'http://purl.org/NET/webdav/mount'); $url = $xml->xpath('//dm:url'); diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php index 63d692ec9..0cf6dc4e4 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/PluginTest.php @@ -44,7 +44,7 @@ class PluginTest extends \Sabre\DAVServerTest ]); $response = $this->request($request); - $this->assertEquals(400, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(400, $response->status, 'Full response body:'.$response->getBodyAsString()); } public function testPatchNotSupported() @@ -56,7 +56,7 @@ class PluginTest extends \Sabre\DAVServerTest ); $response = $this->request($request); - $this->assertEquals(405, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(405, $response->status, 'Full response body:'.$response->getBodyAsString()); } public function testPatchNoContentType() @@ -68,7 +68,7 @@ class PluginTest extends \Sabre\DAVServerTest ); $response = $this->request($request); - $this->assertEquals(415, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(415, $response->status, 'Full response body:'.$response->getBodyAsString()); } public function testPatchBadRange() @@ -80,7 +80,7 @@ class PluginTest extends \Sabre\DAVServerTest ); $response = $this->request($request); - $this->assertEquals(416, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(416, $response->status, 'Full response body:'.$response->getBodyAsString()); } public function testPatchNoLength() @@ -92,7 +92,7 @@ class PluginTest extends \Sabre\DAVServerTest ); $response = $this->request($request); - $this->assertEquals(411, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(411, $response->status, 'Full response body:'.$response->getBodyAsString()); } public function testPatchSuccess() @@ -104,7 +104,7 @@ class PluginTest extends \Sabre\DAVServerTest ); $response = $this->request($request); - $this->assertEquals(204, $response->status, 'Full response body:'.$response->body); + $this->assertEquals(204, $response->status, 'Full response body:'.$response->getBodyAsString()); $this->assertEquals('aaabbbaa', $this->node->get()); } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php index 8e5bc6a64..02c6a4633 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerMKCOLTest.php @@ -26,7 +26,7 @@ class ServerMKCOLTest extends AbstractServer ], $this->response->getHeaders()); $this->assertEquals(201, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertTrue(is_dir($this->tempDir.'/testcol')); } @@ -129,7 +129,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders()); - $this->assertEquals(400, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(400, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -160,7 +160,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders()); - $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -191,7 +191,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Length' => ['0'], ], $this->response->getHeaders()); - $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -224,7 +224,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Length' => ['0'], ], $this->response->getHeaders()); - $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -248,7 +248,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders()); - $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -272,7 +272,7 @@ class ServerMKCOLTest extends AbstractServer 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders()); - $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -297,7 +297,7 @@ class ServerMKCOLTest extends AbstractServer '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->body); + $this->assertEquals(405, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->getBodyAsString()); } /** @@ -323,15 +323,14 @@ class ServerMKCOLTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals(207, $this->response->status, 'Wrong statuscode received. Full response body: '.$this->response->body); + $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()); - $responseBody = $this->response->getBodyAsString(); - $expected = <<<XML <?xml version="1.0"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> @@ -349,7 +348,7 @@ XML; $this->assertXmlStringEqualsXmlString( $expected, - $responseBody + $bodyAsString ); } } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php index 35de59e37..bbf820eb5 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerPluginTest.php @@ -60,7 +60,7 @@ class ServerPluginTest extends AbstractServer ], $this->response->getHeaders()); $this->assertEquals(200, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals('OPTIONS', $this->testPlugin->beforeMethod); } diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php index 462fba664..def9a9cfb 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerPropsTest.php @@ -58,7 +58,7 @@ class ServerPropsTest extends AbstractServer $this->response->getHeaders() ); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -83,7 +83,7 @@ class ServerPropsTest extends AbstractServer $this->response->getHeaders() ); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -105,7 +105,7 @@ class ServerPropsTest extends AbstractServer $this->sendRequest($xml); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -139,7 +139,7 @@ class ServerPropsTest extends AbstractServer $this->sendRequest($xml); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); @@ -157,7 +157,7 @@ class ServerPropsTest extends AbstractServer </d:propfind>'; $this->sendRequest($xml); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); $pathTests = [ diff --git a/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php b/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php index 53153151b..563f558eb 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/ServerSimpleTest.php @@ -42,7 +42,7 @@ class ServerSimpleTest extends AbstractServer ], $this->response->getHeaders()); $this->assertEquals(200, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); } public function testOptionsUnmapped() @@ -62,7 +62,7 @@ class ServerSimpleTest extends AbstractServer ], $this->response->getHeaders()); $this->assertEquals(200, $this->response->status); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); } public function testNonExistantMethod() @@ -371,7 +371,7 @@ class ServerSimpleTest extends AbstractServer $this->response->getHeaders() ); - $this->assertEquals(415, $this->response->status, 'We got an incorrect status back. Full response body follows: '.$this->response->body); + $this->assertEquals(415, $this->response->status, 'We got an incorrect status back. Full response body follows: '.$this->response->getBodyAsString()); } public function testReportIntercepted() @@ -394,7 +394,7 @@ class ServerSimpleTest extends AbstractServer $this->response->getHeaders() ); - $this->assertEquals(418, $this->response->status, 'We got an incorrect status back. Full response body follows: '.$this->response->body); + $this->assertEquals(418, $this->response->status, 'We got an incorrect status back. Full response body follows: '.$this->response->getBodyAsString()); } public function reportHandler($reportName, $result, $path) diff --git a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php index 352c8a3e7..bae5b58bf 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/TemporaryFileFilterTest.php @@ -22,7 +22,7 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals(201, $this->response->status); $this->assertEquals('0', $this->response->getHeader('Content-Length')); @@ -37,7 +37,7 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals(201, $this->response->status); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], @@ -54,7 +54,7 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals(201, $this->response->status); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], @@ -78,7 +78,7 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals(201, $this->response->status); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], @@ -147,7 +147,7 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); $this->assertEquals(201, $this->response->status); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], @@ -157,12 +157,12 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n".$this->response->body); + $this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n".$this->response->getBodyAsString()); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], ], $this->response->getHeaders()); - $this->assertEquals('', $this->response->body); + $this->assertEquals('', $this->response->getBodyAsString()); } public function testPutPropfind() @@ -172,7 +172,8 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = $request; $this->server->exec(); - $this->assertEquals('', $this->response->body); + $bodyAsString = $this->response->getBodyAsString(); + $this->assertEquals('', $bodyAsString); $this->assertEquals(201, $this->response->status); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], @@ -183,13 +184,14 @@ class TemporaryFileFilterTest extends AbstractServer $this->server->httpRequest = ($request); $this->server->exec(); - $this->assertEquals(207, $this->response->status, 'Incorrect status code returned. Body: '.$this->response->body); + $bodyAsString = $this->response->getBodyAsString(); + $this->assertEquals(207, $this->response->status, 'Incorrect status code returned. Body: '.$bodyAsString); $this->assertEquals([ 'X-Sabre-Temp' => ['true'], 'Content-Type' => ['application/xml; charset=utf-8'], ], $this->response->getHeaders()); - $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->body); + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $bodyAsString); $xml = simplexml_load_string($body); $xml->registerXPathNamespace('d', 'urn:DAV'); |