From 8d4744d115036dd7ec4169f8b1fdebebac6fb602 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Mar 2017 11:42:06 +1100 Subject: new composer.lock for red --- .../tests/Sabre/CardDAV/AddressBookQueryTest.php | 51 ++++++++++++++++++++-- .../dav/tests/Sabre/CardDAV/AddressBookTest.php | 6 +-- .../sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php | 13 +++++- .../sabre/dav/tests/Sabre/CardDAV/MultiGetTest.php | 2 +- .../Sabre/CardDAV/SogoStripContentTypeTest.php | 2 +- .../dav/tests/Sabre/CardDAV/ValidateFilterTest.php | 5 +++ .../dav/tests/Sabre/CardDAV/ValidateVCardTest.php | 10 ++--- 7 files changed, 74 insertions(+), 15 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV') diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php index 2c3171bf3..f8da38a16 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookQueryTest.php @@ -2,8 +2,8 @@ namespace Sabre\CardDAV; -use Sabre\HTTP; use Sabre\DAV; +use Sabre\HTTP; require_once 'Sabre/CardDAV/AbstractPluginTest.php'; require_once 'Sabre/HTTP/ResponseMock.php'; @@ -288,14 +288,14 @@ class AddressBookQueryTest extends AbstractPluginTest { ); $request->setBody( -' + ' ' - ); + ); $response = new HTTP\ResponseMock(); @@ -305,6 +305,51 @@ class AddressBookQueryTest extends AbstractPluginTest { $this->server->exec(); $this->assertEquals(415, $response->status, 'Incorrect status code. Full response body:' . $response->body); + } + + function testAddressBookProperties() { + + $request = new HTTP\Request( + 'REPORT', + '/addressbooks/user1/book3', + ['Depth' => '1'] + ); + + $request->setBody( + ' + + + + + + + + +' + ); + + $response = new HTTP\ResponseMock(); + + $this->server->httpRequest = $request; + $this->server->httpResponse = $response; + + $this->server->exec(); + + $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body); + + // using the client for parsing + $client = new DAV\Client(['baseUri' => '/']); + + $result = $client->parseMultiStatus($response->body); + + $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") . '"', + '{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); } } diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php index 1a36fd10c..1f0064dd3 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php @@ -85,7 +85,7 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { function testDelete() { $this->ab->delete(); - $this->assertEquals([], $this->backend->addressBooks); + $this->assertEquals(1, count($this->backend->addressBooks)); } @@ -175,7 +175,7 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { $backend = new Backend\PDO( $this->getPDO() ); - $ab = new AddressBook($backend, [ 'id' => 1, '{DAV:}sync-token' => 2]); + $ab = new AddressBook($backend, ['id' => 1, '{DAV:}sync-token' => 2]); $this->assertEquals(2, $ab->getSyncToken()); } @@ -187,7 +187,7 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase { $backend = new Backend\PDO( $this->getPDO() ); - $ab = new AddressBook($backend, [ 'id' => 1, '{http://sabredav.org/ns}sync-token' => 2]); + $ab = new AddressBook($backend, ['id' => 1, '{http://sabredav.org/ns}sync-token' => 2]); $this->assertEquals(2, $ab->getSyncToken()); } diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php b/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php index 840b898e8..8638dc74a 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/Backend/Mock.php @@ -20,6 +20,12 @@ class Mock extends AbstractBackend { 'principaluri' => 'principals/user1', '{DAV:}displayname' => 'd-name', ], + [ + 'id' => 'bar', + 'uri' => 'book3', + 'principaluri' => 'principals/user1', + '{DAV:}displayname' => 'd-name', + ], ]; $card2 = fopen('php://memory', 'r+'); @@ -30,6 +36,9 @@ class Mock extends AbstractBackend { 'card1' => "BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD", 'card2' => $card2, ], + 'bar' => [ + 'card3' => "BEGIN:VCARD\nVERSION:3.0\nUID:12345\nFN:Test-Card\nEMAIL;TYPE=home:bar@example.org\nEND:VCARD", + ], ]; } @@ -58,7 +67,7 @@ class Mock extends AbstractBackend { * Calling the handle method is like telling the PropPatch object "I * promise I can handle updating this property". * - * Read the PropPatch documenation for more info and examples. + * Read the PropPatch documentation for more info and examples. * * @param string $addressBookId * @param \Sabre\DAV\PropPatch $propPatch @@ -117,7 +126,7 @@ class Mock extends AbstractBackend { * calculating them. If they are specified, you can also ommit carddata. * This may speed up certain requests, especially with large cards. * - * @param mixed $addressbookId + * @param mixed $addressBookId * @return array */ function getCards($addressBookId) { diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/MultiGetTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/MultiGetTest.php index d79239d0f..2d57c6ae7 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/MultiGetTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/MultiGetTest.php @@ -2,8 +2,8 @@ namespace Sabre\CardDAV; -use Sabre\HTTP; use Sabre\DAV; +use Sabre\HTTP; require_once 'Sabre/HTTP/ResponseMock.php'; diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/SogoStripContentTypeTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/SogoStripContentTypeTest.php index 0ba4fd669..d4bc48098 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/SogoStripContentTypeTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/SogoStripContentTypeTest.php @@ -2,8 +2,8 @@ namespace Sabre\CardDAV; -use Sabre\HTTP; use Sabre\DAV\PropFind; +use Sabre\HTTP; class SogoStripContentTypeTest extends \Sabre\DAVServerTest { diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateFilterTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateFilterTest.php index 57ac21b4a..03c468f86 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateFilterTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateFilterTest.php @@ -7,6 +7,11 @@ require_once 'Sabre/CardDAV/AbstractPluginTest.php'; class ValidateFilterTest extends AbstractPluginTest { /** + * @param string $input + * @param array $filters + * @param string $test + * @param bool $result + * @param string|null $message * @dataProvider data */ function testFilter($input, $filters, $test, $result, $message = null) { diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateVCardTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateVCardTest.php index dda8a0c37..acba2cfc8 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateVCardTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/ValidateVCardTest.php @@ -3,8 +3,8 @@ namespace Sabre\CardDAV; use Sabre\DAV; -use Sabre\HTTP; use Sabre\DAVACL; +use Sabre\HTTP; require_once 'Sabre/HTTP/ResponseMock.php'; @@ -293,10 +293,10 @@ VCF; $response = $this->request($request, 204); $expected = [ - 'uri' => 'blabla.vcf', - 'carddata' => $body, - 'size' => strlen($body), - 'etag' => '"' . md5($body) . '"', + 'uri' => 'blabla.vcf', + 'carddata' => $body, + 'size' => strlen($body), + 'etag' => '"' . md5($body) . '"', ]; $this->assertEquals($expected, $this->cardBackend->getCard('addressbook1', 'blabla.vcf')); -- cgit v1.2.3