"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/Sabre/CardDAV/AddressBookQueryTest.php" between
dav-4.0.2.tar.gz and dav-4.0.3.tar.gz

About: sabre/dav is a WebDAV framework for PHP allowing to create WebDAV, CalDAV and CardDAV servers.

AddressBookQueryTest.php  (dav-4.0.2):AddressBookQueryTest.php  (dav-4.0.3)
skipping to change at line 42 skipping to change at line 42
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book1/card1' => [ '/addressbooks/user1/book1/card1' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"',
], ],
], ],
'/addressbooks/user1/book1/card2' => [ '/addressbooks/user1/book1/card2' => [
404 => [ 404 => [
'{DAV:}getetag' => null, '{DAV:}getetag' => null,
skipping to change at line 90 skipping to change at line 91
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book1/card1' => [ '/addressbooks/user1/book1/card1' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"',
], ],
], ],
], $result); ], $result);
} }
skipping to change at line 133 skipping to change at line 135
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$this->assertEquals([], $result); $this->assertEquals([], $result);
} }
public function testQueryLimit() public function testQueryLimit()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1', 'REQUEST_URI' => '/addressbooks/user1/book1',
'HTTP_DEPTH' => '1', 'HTTP_DEPTH' => '1',
skipping to change at line 171 skipping to change at line 174
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book1/card1' => [ '/addressbooks/user1/book1/card1' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"',
], ],
], ],
], $result); ], $result);
} }
skipping to change at line 212 skipping to change at line 216
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$vobjVersion = \Sabre\VObject\Version::VERSION; $vobjVersion = \Sabre\VObject\Version::VERSION;
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book1/card1' => [ '/addressbooks/user1/book1/card1' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\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"]]]', '{urn:ietf:params:xml:ns:carddav}address-data' => '["vcard", [["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject '. $vobjVersion.'\/\/EN"],["uid",{},"text","12345"]]]',
], ],
], ],
skipping to change at line 256 skipping to change at line 261
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$vobjVersion = \Sabre\VObject\Version::VERSION; $vobjVersion = \Sabre\VObject\Version::VERSION;
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book1/card1' => [ '/addressbooks/user1/book1/card1' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nEND:VCARD").'"',
'{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCA RD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject $vobjVersion//EN\r\nUID:1234 5\r\nEND:VCARD\r\n", '{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCA RD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject $vobjVersion//EN\r\nUID:1234 5\r\nEND:VCARD\r\n",
], ],
], ],
skipping to change at line 300 skipping to change at line 306
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $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() public function testAddressBookProperties()
{ {
$request = new HTTP\Request( $request = new HTTP\Request(
'REPORT', 'REPORT',
'/addressbooks/user1/book3', '/addressbooks/user1/book3',
['Depth' => '1'] ['Depth' => '1']
); );
skipping to change at line 331 skipping to change at line 337
</c:addressbook-query>' </c:addressbook-query>'
); );
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->httpResponse = $response; $this->server->httpResponse = $response;
$this->server->exec(); $this->server->exec();
$this->assertEquals(207, $response->status, 'Incorrect status code. Full $bodyAsString = $response->getBodyAsString();
response body:'.$response->body); $this->assertEquals(207, $response->status, 'Incorrect status code. Full
response body:'.$bodyAsString);
// using the client for parsing // using the client for parsing
$client = new DAV\Client(['baseUri' => '/']); $client = new DAV\Client(['baseUri' => '/']);
$result = $client->parseMultiStatus($response->body); $result = $client->parseMultiStatus($bodyAsString);
$this->assertEquals([ $this->assertEquals([
'/addressbooks/user1/book3/card3' => [ '/addressbooks/user1/book3/card3' => [
200 => [ 200 => [
'{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nFN:Test-Card\nEMAIL;TYPE=home:bar@example.org\nEND:VCARD").'"', '{DAV:}getetag' => '"'.md5("BEGIN:VCARD\nVERSION:3.0\nUID:12 345\nFN:Test-Card\nEMAIL;TYPE=home:bar@example.org\nEND:VCARD").'"',
'{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCA RD\r\nVERSION:3.0\r\nUID:12345\r\nFN:Test-Card\r\nEND:VCARD\r\n", '{urn:ietf:params:xml:ns:carddav}address-data' => "BEGIN:VCA RD\r\nVERSION:3.0\r\nUID:12345\r\nFN:Test-Card\r\nEND:VCARD\r\n",
], ],
], ],
], $result); ], $result);
} }
 End of changes. 15 change blocks. 
22 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)