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.php126
1 files changed, 63 insertions, 63 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
index 478f6beb5..2c3171bf3 100644
--- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php
@@ -12,11 +12,11 @@ class AddressBookQueryTest extends AbstractPluginTest {
function testQuery() {
- $request = HTTP\Sapi::createFromServerArray(array(
- 'REQUEST_METHOD' => 'REPORT',
- 'REQUEST_URI' => '/addressbooks/user1/book1',
- 'HTTP_DEPTH' => '1',
- ));
+ $request = new HTTP\Request(
+ 'REPORT',
+ '/addressbooks/user1/book1',
+ ['Depth' => '1']
+ );
$request->setBody(
'<?xml version="1.0"?>
@@ -40,33 +40,33 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
- $this->assertEquals(array(
- '/addressbooks/user1/book1/card1' => array(
- 200 => array(
+ $this->assertEquals([
+ '/addressbooks/user1/book1/card1' => [
+ 200 => [
'{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
- ),
- ),
- '/addressbooks/user1/book1/card2' => array(
- 404 => array(
+ ],
+ ],
+ '/addressbooks/user1/book1/card2' => [
+ 404 => [
'{DAV:}getetag' => null,
- ),
- )
- ), $result);
+ ],
+ ]
+ ], $result);
}
function testQueryDepth0() {
- $request = HTTP\Sapi::createFromServerArray(array(
- 'REQUEST_METHOD' => 'REPORT',
- 'REQUEST_URI' => '/addressbooks/user1/book1/card1',
- 'HTTP_DEPTH' => '0',
- ));
+ $request = new HTTP\Request(
+ 'REPORT',
+ '/addressbooks/user1/book1/card1',
+ ['Depth' => '0']
+ );
$request->setBody(
'<?xml version="1.0"?>
@@ -90,28 +90,28 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
- $this->assertEquals(array(
- '/addressbooks/user1/book1/card1' => array(
- 200 => array(
+ $this->assertEquals([
+ '/addressbooks/user1/book1/card1' => [
+ 200 => [
'{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
- ),
- ),
- ), $result);
+ ],
+ ],
+ ], $result);
}
function testQueryNoMatch() {
- $request = HTTP\Sapi::createFromServerArray(array(
- 'REQUEST_METHOD' => 'REPORT',
- 'REQUEST_URI' => '/addressbooks/user1/book1',
- 'HTTP_DEPTH' => '1',
- ));
+ $request = new HTTP\Request(
+ 'REPORT',
+ '/addressbooks/user1/book1',
+ ['Depth' => '1']
+ );
$request->setBody(
'<?xml version="1.0"?>
@@ -135,21 +135,21 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
- $this->assertEquals(array(), $result);
+ $this->assertEquals([], $result);
}
function testQueryLimit() {
- $request = HTTP\Sapi::createFromServerArray(array(
+ $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(
'<?xml version="1.0"?>
@@ -174,17 +174,17 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
- $this->assertEquals(array(
- '/addressbooks/user1/book1/card1' => array(
- 200 => array(
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD"). '"',
- ),
- ),
- ), $result);
+ $this->assertEquals([
+ '/addressbooks/user1/book1/card1' => [
+ 200 => [
+ '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD") . '"',
+ ],
+ ],
+ ], $result);
}
@@ -217,20 +217,20 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
$vobjVersion = \Sabre\VObject\Version::VERSION;
- $this->assertEquals(array(
- '/addressbooks/user1/book1/card1' => array(
- 200 => array(
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD"). '"',
+ $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"]]]',
- ),
- ),
- ), $result);
+ ],
+ ],
+ ], $result);
}
@@ -262,20 +262,20 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
- $client = new DAV\Client(array('baseUri'=>'/'));
+ $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body);
$vobjVersion = \Sabre\VObject\Version::VERSION;
- $this->assertEquals(array(
- '/addressbooks/user1/book1/card1' => array(
- 200 => array(
- '{DAV:}getetag' => '"' . md5("BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD"). '"',
+ $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' => "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject $vobjVersion//EN\r\nUID:12345\r\nEND:VCARD\r\n",
- ),
- ),
- ), $result);
+ ],
+ ],
+ ], $result);
}