"Fossies" - the Fresh Open Source Software Archive  

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

ServerSimpleTest.php  (dav-4.0.2):ServerSimpleTest.php  (dav-4.0.3)
skipping to change at line 45 skipping to change at line 45
$this->assertEquals([ $this->assertEquals([
'DAV' => ['1, 3, extended-mkcol'], 'DAV' => ['1, 3, extended-mkcol'],
'MS-Author-Via' => ['DAV'], 'MS-Author-Via' => ['DAV'],
'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, C OPY, MOVE, REPORT'], 'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, C OPY, MOVE, REPORT'],
'Accept-Ranges' => ['bytes'], 'Accept-Ranges' => ['bytes'],
'Content-Length' => ['0'], 'Content-Length' => ['0'],
'X-Sabre-Version' => [Version::VERSION], 'X-Sabre-Version' => [Version::VERSION],
], $this->response->getHeaders()); ], $this->response->getHeaders());
$this->assertEquals(200, $this->response->status); $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body); $this->assertEquals('', $this->response->getBodyAsString());
} }
public function testOptionsUnmapped() public function testOptionsUnmapped()
{ {
$request = new HTTP\Request('OPTIONS', '/unmapped'); $request = new HTTP\Request('OPTIONS', '/unmapped');
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->exec(); $this->server->exec();
$this->assertEquals([ $this->assertEquals([
'DAV' => ['1, 3, extended-mkcol'], 'DAV' => ['1, 3, extended-mkcol'],
'MS-Author-Via' => ['DAV'], 'MS-Author-Via' => ['DAV'],
'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, C OPY, MOVE, REPORT, MKCOL'], 'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, C OPY, MOVE, REPORT, MKCOL'],
'Accept-Ranges' => ['bytes'], 'Accept-Ranges' => ['bytes'],
'Content-Length' => ['0'], 'Content-Length' => ['0'],
'X-Sabre-Version' => [Version::VERSION], 'X-Sabre-Version' => [Version::VERSION],
], $this->response->getHeaders()); ], $this->response->getHeaders());
$this->assertEquals(200, $this->response->status); $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body); $this->assertEquals('', $this->response->getBodyAsString());
} }
public function testNonExistantMethod() public function testNonExistantMethod()
{ {
$serverVars = [ $serverVars = [
'REQUEST_URI' => '/', 'REQUEST_URI' => '/',
'REQUEST_METHOD' => 'BLABLA', 'REQUEST_METHOD' => 'BLABLA',
]; ];
$request = HTTP\Sapi::createFromServerArray($serverVars); $request = HTTP\Sapi::createFromServerArray($serverVars);
skipping to change at line 374 skipping to change at line 374
$this->server->httpRequest->setBody('<?xml version="1.0"?><bla:myreport xmlns:bla="http://www.rooftopsolutions.nl/NS"></bla:myreport>'); $this->server->httpRequest->setBody('<?xml version="1.0"?><bla:myreport xmlns:bla="http://www.rooftopsolutions.nl/NS"></bla:myreport>');
$this->server->exec(); $this->server->exec();
$this->assertEquals([ $this->assertEquals([
'X-Sabre-Version' => [Version::VERSION], 'X-Sabre-Version' => [Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'], 'Content-Type' => ['application/xml; charset=utf-8'],
], ],
$this->response->getHeaders() $this->response->getHeaders()
); );
$this->assertEquals(415, $this->response->status, 'We got an incorrect s tatus back. Full response body follows: '.$this->response->body); $this->assertEquals(415, $this->response->status, 'We got an incorrect s tatus back. Full response body follows: '.$this->response->getBodyAsString());
} }
public function testReportIntercepted() public function testReportIntercepted()
{ {
$serverVars = [ $serverVars = [
'REQUEST_URI' => '/', 'REQUEST_URI' => '/',
'REQUEST_METHOD' => 'REPORT', 'REQUEST_METHOD' => 'REPORT',
]; ];
$request = HTTP\Sapi::createFromServerArray($serverVars); $request = HTTP\Sapi::createFromServerArray($serverVars);
skipping to change at line 397 skipping to change at line 397
$this->server->on('report', [$this, 'reportHandler']); $this->server->on('report', [$this, 'reportHandler']);
$this->server->exec(); $this->server->exec();
$this->assertEquals([ $this->assertEquals([
'X-Sabre-Version' => [Version::VERSION], 'X-Sabre-Version' => [Version::VERSION],
'testheader' => ['testvalue'], 'testheader' => ['testvalue'],
], ],
$this->response->getHeaders() $this->response->getHeaders()
); );
$this->assertEquals(418, $this->response->status, 'We got an incorrect s tatus back. Full response body follows: '.$this->response->body); $this->assertEquals(418, $this->response->status, 'We got an incorrect s tatus back. Full response body follows: '.$this->response->getBodyAsString());
} }
public function reportHandler($reportName, $result, $path) public function reportHandler($reportName, $result, $path)
{ {
if ('{http://www.rooftopsolutions.nl/NS}myreport' == $reportName) { if ('{http://www.rooftopsolutions.nl/NS}myreport' == $reportName) {
$this->server->httpResponse->setStatus(418); $this->server->httpResponse->setStatus(418);
$this->server->httpResponse->setHeader('testheader', 'testvalue'); $this->server->httpResponse->setHeader('testheader', 'testvalue');
return false; return false;
} else { } else {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

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