"Fossies" - the Fresh Open Source Software Archive  

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

ServerPropsTest.php  (dav-4.0.2):ServerPropsTest.php  (dav-4.0.3)
skipping to change at line 61 skipping to change at line 61
$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"', $this->response->getBodyAsString());
$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');
$this->assertEquals(1, count($data)); $this->assertEquals(1, count($data));
} }
skipping to change at line 86 skipping to change at line 86
$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"', $this->response->getBodyAsString());
$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('/test2.txt', (string) $data, 'href element should h ave been /test2.txt'); $this->assertEquals('/test2.txt', (string) $data, 'href element should h ave been /test2.txt');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:getco ntentlength'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:getco ntentlength');
$this->assertEquals(1, count($data)); $this->assertEquals(1, count($data));
} }
skipping to change at line 108 skipping to change at line 108
{ {
$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:supportedlock /> <d:supportedlock />
</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:suppo rtedlock/d:lockentry'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rtedlock/d:lockentry');
$this->assertEquals(2, count($data), 'We expected two \'d:lockentry\' ta gs'); $this->assertEquals(2, count($data), 'We expected two \'d:lockentry\' ta gs');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rtedlock/d:lockentry/d:lockscope'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rtedlock/d:lockentry/d:lockscope');
$this->assertEquals(2, count($data), 'We expected two \'d:lockscope\' ta gs'); $this->assertEquals(2, count($data), 'We expected two \'d:lockscope\' ta gs');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rtedlock/d:lockentry/d:locktype'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rtedlock/d:lockentry/d:locktype');
skipping to change at line 142 skipping to change at line 142
{ {
$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(1, count($data), 'We expected a \'d:lockdiscovery\' tag'); $this->assertEquals(1, count($data), 'We expected a \'d:lockdiscovery\' tag');
} }
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',
]; ];
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

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