"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/Sabre/DAV/Mount/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 31 skipping to change at line 31
{ {
$serverVars = [ $serverVars = [
'REQUEST_URI' => '/', 'REQUEST_URI' => '/',
'REQUEST_METHOD' => 'GET', 'REQUEST_METHOD' => 'GET',
]; ];
$request = HTTP\Sapi::createFromServerArray($serverVars); $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request); $this->server->httpRequest = ($request);
$this->server->exec(); $this->server->exec();
$this->assertEquals(501, $this->response->status, 'We expected GET to no t be implemented for Directories. Response body: '.$this->response->body); $this->assertEquals(501, $this->response->status, 'We expected GET to no t be implemented for Directories. Response body: '.$this->response->getBodyAsStr ing());
} }
public function testMountResponse() public function testMountResponse()
{ {
$serverVars = [ $serverVars = [
'REQUEST_URI' => '/?mount', 'REQUEST_URI' => '/?mount',
'REQUEST_METHOD' => 'GET', 'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => 'mount', 'QUERY_STRING' => 'mount',
'HTTP_HOST' => 'example.org', 'HTTP_HOST' => 'example.org',
]; ];
$request = HTTP\Sapi::createFromServerArray($serverVars); $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request); $this->server->httpRequest = ($request);
$this->server->exec(); $this->server->exec();
$this->assertEquals(200, $this->response->status); $this->assertEquals(200, $this->response->status);
$xml = simplexml_load_string($this->response->body); $xml = simplexml_load_string($this->response->getBodyAsString());
$this->assertInstanceOf('SimpleXMLElement', $xml, 'Response was not a va $this->assertInstanceOf('SimpleXMLElement', $xml, 'Response was not a va
lid xml document. The list of errors:'.print_r(libxml_get_errors(), true).'. xml lid xml document. The list of errors:'.print_r(libxml_get_errors(), true).'. xml
body: '.$this->response->body.'. What type we got: '.gettype($xml).' class, if body: '.$this->response->getBodyAsString().'. What type we got: '.gettype($xml)
object: '.get_class($xml)); .' class, if object: '.get_class($xml));
$xml->registerXPathNamespace('dm', 'http://purl.org/NET/webdav/mount'); $xml->registerXPathNamespace('dm', 'http://purl.org/NET/webdav/mount');
$url = $xml->xpath('//dm:url'); $url = $xml->xpath('//dm:url');
$this->assertEquals('http://example.org/', (string) $url[0]); $this->assertEquals('http://example.org/', (string) $url[0]);
} }
} }
 End of changes. 2 change blocks. 
6 lines changed or deleted 6 lines changed or added

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