diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php index 6e7e13106..a86d85144 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php @@ -7,9 +7,6 @@ namespace Sabre\CardDAV; use Sabre\DAV; use Sabre\HTTP; -require_once 'Sabre/CardDAV/AbstractPluginTest.php'; -require_once 'Sabre/HTTP/ResponseMock.php'; - class AddressBookQueryTest extends AbstractPluginTest { public function testQuery() @@ -39,12 +36,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $this->assertEquals([ '/addressbooks/user1/book1/card1' => [ @@ -87,12 +85,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $this->assertEquals([ '/addressbooks/user1/book1/card1' => [ @@ -130,12 +129,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $this->assertEquals([], $result); } @@ -168,12 +168,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $this->assertEquals([ '/addressbooks/user1/book1/card1' => [ @@ -209,12 +210,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $vobjVersion = \Sabre\VObject\Version::VERSION; @@ -253,12 +255,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $vobjVersion = \Sabre\VObject\Version::VERSION; @@ -297,7 +300,7 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(415, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $this->assertEquals(415, $response->status, 'Incorrect status code. Full response body:'.$response->getBodyAsString()); } public function testAddressBookProperties() @@ -328,12 +331,13 @@ class AddressBookQueryTest extends AbstractPluginTest $this->server->exec(); - $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body); + $bodyAsString = $response->getBodyAsString(); + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$bodyAsString); // using the client for parsing $client = new DAV\Client(['baseUri' => '/']); - $result = $client->parseMultiStatus($response->body); + $result = $client->parseMultiStatus($bodyAsString); $this->assertEquals([ '/addressbooks/user1/book3/card3' => [ |