"Fossies" - the Fresh Open Source Software Archive  

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

SupportedReportSetTest.php  (dav-4.0.2):SupportedReportSetTest.php  (dav-4.0.3)
skipping to change at line 41 skipping to change at line 41
{ {
$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:supported-report-set /> <d:supported-report-set />
</d:prop> </d:prop>
</d:propfind>'; </d:propfind>';
$this->sendPROPFIND($xml); $this->sendPROPFIND($xml);
$this->assertEquals(207, $this->response->status, 'We expected a multi-s $bodyAsString = $this->response->getBodyAsString();
tatus response. Full response body: '.$this->response->body); $this->assertEquals(207, $this->response->status, 'We expected a multi-s
tatus response. Full response body: '.$bodyAsString);
$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');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop');
$this->assertEquals(1, count($data), 'We expected 1 \'d:prop\' element') ; $this->assertEquals(1, count($data), 'We expected 1 \'d:prop\' element') ;
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set');
$this->assertEquals(1, count($data), 'We expected 1 \'d:supported-report -set\' element'); $this->assertEquals(1, count($data), 'We expected 1 \'d:supported-report -set\' element');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status');
skipping to change at line 81 skipping to change at line 82
$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:supported-report-set /> <d:supported-report-set />
</d:prop> </d:prop>
</d:propfind>'; </d:propfind>';
$this->sendPROPFIND($xml); $this->sendPROPFIND($xml);
$this->assertEquals(207, $this->response->status, 'We expected a multi-s $bodyAsString = $this->response->getBodyAsString();
tatus response. Full response body: '.$this->response->body); $this->assertEquals(207, $this->response->status, 'We expected a multi-s
tatus response. Full response body: '.$bodyAsString);
$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');
$xml->registerXPathNamespace('x', 'http://www.rooftopsolutions.nl/testna mespace'); $xml->registerXPathNamespace('x', 'http://www.rooftopsolutions.nl/testna mespace');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop');
$this->assertEquals(1, count($data), 'We expected 1 \'d:prop\' element') ; $this->assertEquals(1, count($data), 'We expected 1 \'d:prop\' element') ;
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set');
$this->assertEquals(1, count($data), 'We expected 1 \'d:supported-report -set\' element'); $this->assertEquals(1, count($data), 'We expected 1 \'d:supported-report -set\' element');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report');
$this->assertEquals(2, count($data), 'We expected 2 \'d:supported-report \' elements'); $this->assertEquals(2, count($data), 'We expected 2 \'d:supported-report \' elements');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report');
$this->assertEquals(2, count($data), 'We expected 2 \'d:report\' element s'); $this->assertEquals(2, count($data), 'We expected 2 \'d:report\' element s');
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report/x:myreport'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report/x:myreport');
$this->assertEquals(1, count($data), 'We expected 1 \'x:myreport\' eleme nt. Full body: '.$this->response->body); $this->assertEquals(1, count($data), 'We expected 1 \'x:myreport\' eleme nt. Full body: '.$bodyAsString);
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report/d:anotherreport'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:prop/d:suppo rted-report-set/d:supported-report/d:report/d:anotherreport');
$this->assertEquals(1, count($data), 'We expected 1 \'d:anotherreport\' element. Full body: '.$this->response->body); $this->assertEquals(1, count($data), 'We expected 1 \'d:anotherreport\' element. Full body: '.$bodyAsString);
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status'); $data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status');
$this->assertEquals(1, count($data), 'We expected 1 \'d:status\' element '); $this->assertEquals(1, count($data), 'We expected 1 \'d:status\' element ');
$this->assertEquals('HTTP/1.1 200 OK', (string) $data[0], 'The status fo r this property should have been 200'); $this->assertEquals('HTTP/1.1 200 OK', (string) $data[0], 'The status fo r this property should have been 200');
} }
} }
 End of changes. 6 change blocks. 
8 lines changed or deleted 10 lines changed or added

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