"Fossies" - the Fresh Open Source Software Archive  

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

ServerPropsInfiniteDepthTest.php  (dav-4.0.2):ServerPropsInfiniteDepthTest.php  (dav-4.0.3)
skipping to change at line 53 skipping to change at line 53
$request->setBody($body); $request->setBody($body);
$this->server->httpRequest = $request; $this->server->httpRequest = $request;
$this->server->exec(); $this->server->exec();
} }
public function testPropFindEmptyBody() public function testPropFindEmptyBody()
{ {
$this->sendRequest(''); $this->sendRequest('');
$this->assertEquals(207, $this->response->status, 'Incorrect status rece $bodyAsString = $this->response->getBodyAsString();
ived. Full response body: '.$this->response->getBodyAsString()); $this->assertEquals(207, $this->response->status, 'Incorrect status rece
ived. Full response body: '.$bodyAsString);
$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'],
'DAV' => ['1, 3, extended-mkcol, 2'], 'DAV' => ['1, 3, extended-mkcol, 2'],
'Vary' => ['Brief,Prefer'], 'Vary' => ['Brief,Prefer'],
], ],
$this->response->getHeaders() $this->response->getHeaders()
); );
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->body); $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $bodyAsString);
$xml = simplexml_load_string($body); $xml = simplexml_load_string($body);
$xml->registerXPathNamespace('d', 'urn:DAV'); $xml->registerXPathNamespace('d', 'urn:DAV');
list($data) = $xml->xpath('/d:multistatus/d:response/d:href'); list($data) = $xml->xpath('/d:multistatus/d:response/d:href');
$this->assertEquals('/', (string) $data, 'href element should have been /'); $this->assertEquals('/', (string) $data, 'href element should have been /');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:resou rcetype'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:resou rcetype');
// 8 resources are to be returned: /, col, col/col, col/col/test.txt, di r, dir/child.txt, test.txt and test2.txt // 8 resources are to be returned: /, col, col/col, col/col/test.txt, di r, dir/child.txt, test.txt and test2.txt
$this->assertEquals(8, count($data)); $this->assertEquals(8, count($data));
} }
skipping to change at line 124 skipping to change at line 125
{ {
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:"> <d:propfind xmlns:d="DAV:">
<d:prop> <d:prop>
<d:lockdiscovery /> <d:lockdiscovery />
</d:prop> </d:prop>
</d:propfind>'; </d:propfind>';
$this->sendRequest($xml); $this->sendRequest($xml);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->body); $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->getBodyAsString());
$xml = simplexml_load_string($body); $xml = simplexml_load_string($body);
$xml->registerXPathNamespace('d', 'urn:DAV'); $xml->registerXPathNamespace('d', 'urn:DAV');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:lockd iscovery'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:lockd iscovery');
$this->assertEquals(8, count($data), 'We expected eight \'d:lockdiscover y\' tags'); $this->assertEquals(8, count($data), 'We expected eight \'d:lockdiscover y\' tags');
} }
public function testUnknownProperty() public function testUnknownProperty()
{ {
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:"> <d:propfind xmlns:d="DAV:">
<d:prop> <d:prop>
<d:macaroni /> <d:macaroni />
</d:prop> </d:prop>
</d:propfind>'; </d:propfind>';
$this->sendRequest($xml); $this->sendRequest($xml);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->body); $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->getBodyAsString());
$xml = simplexml_load_string($body); $xml = simplexml_load_string($body);
$xml->registerXPathNamespace('d', 'urn:DAV'); $xml->registerXPathNamespace('d', 'urn:DAV');
$pathTests = [ $pathTests = [
'/d:multistatus', '/d:multistatus',
'/d:multistatus/d:response', '/d:multistatus/d:response',
'/d:multistatus/d:response/d:propstat', '/d:multistatus/d:response/d:propstat',
'/d:multistatus/d:response/d:propstat/d:status', '/d:multistatus/d:response/d:propstat/d:status',
'/d:multistatus/d:response/d:propstat/d:prop', '/d:multistatus/d:response/d:propstat/d:prop',
'/d:multistatus/d:response/d:propstat/d:prop/d:macaroni', '/d:multistatus/d:response/d:propstat/d:prop/d:macaroni',
]; ];
skipping to change at line 172 skipping to change at line 173
public function testFilesThatAreSiblingsOfDirectoriesShouldBeReportedAsFiles () public function testFilesThatAreSiblingsOfDirectoriesShouldBeReportedAsFiles ()
{ {
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:"> <d:propfind xmlns:d="DAV:">
<d:prop> <d:prop>
<d:resourcetype /> <d:resourcetype />
</d:prop> </d:prop>
</d:propfind>'; </d:propfind>';
$this->sendRequest($xml); $this->sendRequest($xml);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->body); $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmln s\\1="urn:DAV"', $this->response->getBodyAsString());
$xml = simplexml_load_string($body); $xml = simplexml_load_string($body);
$xml->registerXPathNamespace('d', 'urn:DAV'); $xml->registerXPathNamespace('d', 'urn:DAV');
$pathTests = [ $pathTests = [
'/d:multistatus', '/d:multistatus',
'/d:multistatus/d:response', '/d:multistatus/d:response',
'/d:multistatus/d:response/d:href', '/d:multistatus/d:response/d:href',
'/d:multistatus/d:response/d:propstat', '/d:multistatus/d:response/d:propstat',
'/d:multistatus/d:response/d:propstat/d:status', '/d:multistatus/d:response/d:propstat/d:status',
'/d:multistatus/d:response/d:propstat/d:prop', '/d:multistatus/d:response/d:propstat/d:prop',
'/d:multistatus/d:response/d:propstat/d:prop/d:resourcetype', '/d:multistatus/d:response/d:propstat/d:prop/d:resourcetype',
 End of changes. 5 change blocks. 
6 lines changed or deleted 7 lines changed or added

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