"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/Sabre/DAV/Sync/PluginTest.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.

PluginTest.php  (dav-4.0.2):PluginTest.php  (dav-4.0.3)
skipping to change at line 95 skipping to change at line 95
<D:prop> <D:prop>
<D:getcontentlength/> <D:getcontentlength/>
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
$multiStatus = $this->server->xml->parse($response->getBodyAsString()); $multiStatus = $this->server->xml->parse($response->getBodyAsString());
// Checking the sync-token // Checking the sync-token
$this->assertEquals( $this->assertEquals(
'http://sabre.io/ns/sync/1', 'http://sabre.io/ns/sync/1',
$multiStatus->getSyncToken() $multiStatus->getSyncToken()
); );
$responses = $multiStatus->getResponses(); $responses = $multiStatus->getResponses();
skipping to change at line 157 skipping to change at line 157
<D:prop> <D:prop>
<D:getcontentlength/> <D:getcontentlength/>
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
$multiStatus = $this->server->xml->parse($response->getBodyAsString()); $multiStatus = $this->server->xml->parse($response->getBodyAsString());
// Checking the sync-token // Checking the sync-token
$this->assertEquals( $this->assertEquals(
'http://sabre.io/ns/sync/2', 'http://sabre.io/ns/sync/2',
$multiStatus->getSyncToken() $multiStatus->getSyncToken()
); );
$responses = $multiStatus->getResponses(); $responses = $multiStatus->getResponses();
skipping to change at line 216 skipping to change at line 216
<D:getcontentlength/> <D:getcontentlength/>
</D:prop> </D:prop>
<D:limit><D:nresults>1</D:nresults></D:limit> <D:limit><D:nresults>1</D:nresults></D:limit>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
$multiStatus = $this->server->xml->parse( $multiStatus = $this->server->xml->parse(
$response->getBodyAsString() $response->getBodyAsString()
); );
// Checking the sync-token // Checking the sync-token
$this->assertEquals( $this->assertEquals(
'http://sabre.io/ns/sync/2', 'http://sabre.io/ns/sync/2',
$multiStatus->getSyncToken() $multiStatus->getSyncToken()
); );
skipping to change at line 266 skipping to change at line 266
<D:prop> <D:prop>
<D:getcontentlength/> <D:getcontentlength/>
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(207, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
$multiStatus = $this->server->xml->parse( $multiStatus = $this->server->xml->parse(
$response->getBodyAsString() $response->getBodyAsString()
); );
// Checking the sync-token // Checking the sync-token
$this->assertEquals( $this->assertEquals(
'http://sabre.io/ns/sync/2', 'http://sabre.io/ns/sync/2',
$multiStatus->getSyncToken() $multiStatus->getSyncToken()
); );
skipping to change at line 323 skipping to change at line 323
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(415, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(415, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testSyncNoSyncCollection() public function testSyncNoSyncCollection()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/normalcoll/', 'REQUEST_URI' => '/normalcoll/',
'CONTENT_TYPE' => 'application/xml', 'CONTENT_TYPE' => 'application/xml',
]); ]);
skipping to change at line 351 skipping to change at line 351
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(415, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(415, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testSyncInvalidToken() public function testSyncInvalidToken()
{ {
$this->collection->addChange(['file1.txt'], [], []); $this->collection->addChange(['file1.txt'], [], []);
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/', 'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml', 'CONTENT_TYPE' => 'application/xml',
]); ]);
skipping to change at line 380 skipping to change at line 380
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(403, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(403, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testSyncInvalidTokenNoPrefix() public function testSyncInvalidTokenNoPrefix()
{ {
$this->collection->addChange(['file1.txt'], [], []); $this->collection->addChange(['file1.txt'], [], []);
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/', 'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml', 'CONTENT_TYPE' => 'application/xml',
]); ]);
skipping to change at line 409 skipping to change at line 409
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(403, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(403, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testSyncNoSyncToken() public function testSyncNoSyncToken()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/', 'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml', 'CONTENT_TYPE' => 'application/xml',
]); ]);
skipping to change at line 436 skipping to change at line 436
</D:prop> </D:prop>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(400, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(400, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testSyncNoProp() public function testSyncNoProp()
{ {
$this->collection->addChange(['file1.txt'], [], []); $this->collection->addChange(['file1.txt'], [], []);
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/', 'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml', 'CONTENT_TYPE' => 'application/xml',
]); ]);
skipping to change at line 462 skipping to change at line 462
<D:sync-level>1</D:sync-level> <D:sync-level>1</D:sync-level>
</D:sync-collection> </D:sync-collection>
BLA; BLA;
$request->setBody($body); $request->setBody($body);
$response = $this->request($request); $response = $this->request($request);
// The default state has no sync-token, so this report should not yet // The default state has no sync-token, so this report should not yet
// be supported. // be supported.
$this->assertEquals(400, $response->status, 'Full response body:'.$respo nse->body); $this->assertEquals(400, $response->status, 'Full response body:'.$respo nse->getBodyAsString());
} }
public function testIfConditions() public function testIfConditions()
{ {
$this->collection->addChange(['file1.txt'], [], []); $this->collection->addChange(['file1.txt'], [], []);
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'DELETE', 'REQUEST_METHOD' => 'DELETE',
'REQUEST_URI' => '/coll/file1.txt', 'REQUEST_URI' => '/coll/file1.txt',
'HTTP_IF' => '</coll> (<http://sabre.io/ns/sync/1>)', 'HTTP_IF' => '</coll> (<http://sabre.io/ns/sync/1>)',
]); ]);
 End of changes. 10 change blocks. 
10 lines changed or deleted 10 lines changed or added

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