aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php84
1 files changed, 38 insertions, 46 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
index f8da38a16..6e7e13106 100644
--- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CardDAV;
use Sabre\DAV;
@@ -8,10 +10,10 @@ use Sabre\HTTP;
require_once 'Sabre/CardDAV/AbstractPluginTest.php';
require_once 'Sabre/HTTP/ResponseMock.php';
-class AddressBookQueryTest extends AbstractPluginTest {
-
- function testQuery() {
-
+class AddressBookQueryTest extends AbstractPluginTest
+{
+ public function testQuery()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1',
@@ -37,7 +39,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -47,21 +49,19 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book1/card1' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD").'"',
],
],
'/addressbooks/user1/book1/card2' => [
404 => [
'{DAV:}getetag' => null,
],
- ]
+ ],
], $result);
-
-
}
- function testQueryDepth0() {
-
+ public function testQueryDepth0()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1/card1',
@@ -87,7 +87,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -97,16 +97,14 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book1/card1' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD").'"',
],
],
], $result);
-
-
}
- function testQueryNoMatch() {
-
+ public function testQueryNoMatch()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1',
@@ -132,7 +130,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -140,15 +138,14 @@ class AddressBookQueryTest extends AbstractPluginTest {
$result = $client->parseMultiStatus($response->body);
$this->assertEquals([], $result);
-
}
- function testQueryLimit() {
-
+ public function testQueryLimit()
+ {
$request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
- 'REQUEST_URI' => '/addressbooks/user1/book1',
- 'HTTP_DEPTH' => '1',
+ 'REQUEST_URI' => '/addressbooks/user1/book1',
+ 'HTTP_DEPTH' => '1',
]);
$request->setBody(
@@ -171,7 +168,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -181,16 +178,14 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book1/card1' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD").'"',
],
],
], $result);
-
-
}
- function testJson() {
-
+ public function testJson()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1/card1',
@@ -214,7 +209,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -226,16 +221,15 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book1/card1' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
- '{urn:ietf:params:xml:ns:carddav}address-data' => '["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject ' . $vobjVersion . '\/\/EN"],["uid",{},"text","12345"]]]',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD").'"',
+ '{urn:ietf:params:xml:ns:carddav}address-data' => '["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject '.$vobjVersion.'\/\/EN"],["uid",{},"text","12345"]]]',
],
],
], $result);
-
}
- function testVCard4() {
-
+ public function testVCard4()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1/card1',
@@ -259,7 +253,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -271,16 +265,15 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book1/card1' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD").'"',
'{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject $vobjVersion//EN\r\nUID:12345\r\nEND:VCARD\r\n",
],
],
], $result);
-
}
- function testAddressBookDepth0() {
-
+ public function testAddressBookDepth0()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book1',
@@ -304,11 +297,11 @@ 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->body);
}
- function testAddressBookProperties() {
-
+ public function testAddressBookProperties()
+ {
$request = new HTTP\Request(
'REPORT',
'/addressbooks/user1/book3',
@@ -335,7 +328,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:'.$response->body);
// using the client for parsing
$client = new DAV\Client(['baseUri' => '/']);
@@ -345,11 +338,10 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals([
'/addressbooks/user1/book3/card3' => [
200 => [
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nFN:Test-Card\nEMAIL;TYPE=home:bar@example.org\nEND:VCARD") . '"',
+ '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nFN:Test-Card\nEMAIL;TYPE=home:bar@example.org\nEND:VCARD").'"',
'{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCARD\r\nVERSION:3.0\r\nUID:12345\r\nFN:Test-Card\r\nEND:VCARD\r\n",
],
],
], $result);
-
}
}