"Fossies" - the Fresh Open Source Software Archive  

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

SharingPluginTest.php  (dav-4.0.2):SharingPluginTest.php  (dav-4.0.3)
skipping to change at line 134 skipping to change at line 134
public function testUnknownMethodNoPOST() public function testUnknownMethodNoPOST()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'PATCH', 'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/', 'REQUEST_URI' => '/',
]); ]);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(501, $response->status, $response->body); $this->assertEquals(501, $response->status, $response->getBodyAsString() );
} }
public function testUnknownMethodNoXML() public function testUnknownMethodNoXML()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'POST', 'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/', 'REQUEST_URI' => '/',
'CONTENT_TYPE' => 'text/plain', 'CONTENT_TYPE' => 'text/plain',
]); ]);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(501, $response->status, $response->body); $this->assertEquals(501, $response->status, $response->getBodyAsString() );
} }
public function testUnknownMethodNoNode() public function testUnknownMethodNoNode()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'POST', 'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/foo', 'REQUEST_URI' => '/foo',
'CONTENT_TYPE' => 'text/xml', 'CONTENT_TYPE' => 'text/xml',
]); ]);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(501, $response->status, $response->body); $this->assertEquals(501, $response->status, $response->getBodyAsString() );
} }
public function testShareRequest() public function testShareRequest()
{ {
$request = new HTTP\Request('POST', '/calendars/user1/cal1', ['Content-T ype' => 'text/xml']); $request = new HTTP\Request('POST', '/calendars/user1/cal1', ['Content-T ype' => 'text/xml']);
$xml = <<<RRR $xml = <<<RRR
<?xml version="1.0"?> <?xml version="1.0"?>
<cs:share xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:"> <cs:share xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
<cs:set> <cs:set>
skipping to change at line 253 skipping to change at line 253
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:"> <cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:">
<cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl> <cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl>
<cs:invite-accepted /> <cs:invite-accepted />
</cs:invite-reply> </cs:invite-reply>
'; ';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(200, $response->status, $response->body); $this->assertEquals(200, $response->status, $response->getBodyAsString() );
} }
public function testInviteBadXML() public function testInviteBadXML()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'POST', 'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1', 'REQUEST_URI' => '/calendars/user1',
'CONTENT_TYPE' => 'text/xml', 'CONTENT_TYPE' => 'text/xml',
]); ]);
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:"> <cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:">
</cs:invite-reply> </cs:invite-reply>
'; ';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(400, $response->status, $response->body); $this->assertEquals(400, $response->status, $response->getBodyAsString() );
} }
public function testInviteWrongUrl() public function testInviteWrongUrl()
{ {
$request = HTTP\Sapi::createFromServerArray([ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'POST', 'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal1', 'REQUEST_URI' => '/calendars/user1/cal1',
'CONTENT_TYPE' => 'text/xml', 'CONTENT_TYPE' => 'text/xml',
]); ]);
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:"> <cs:invite-reply xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:">
<cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl> <cs:hosturl><d:href>/principals/owner</d:href></cs:hosturl>
</cs:invite-reply> </cs:invite-reply>
'; ';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(501, $response->status, $response->body); $this->assertEquals(501, $response->status, $response->getBodyAsString() );
// If the plugin did not handle this request, it must ensure that the // If the plugin did not handle this request, it must ensure that the
// body is still accessible by other plugins. // body is still accessible by other plugins.
$this->assertEquals($xml, $request->getBody(true)); $this->assertEquals($xml, $request->getBody(true));
} }
public function testPostWithoutContentType() public function testPostWithoutContentType()
{ {
$request = new HTTP\Request('POST', '/'); $request = new HTTP\Request('POST', '/');
$response = new HTTP\ResponseMock(); $response = new HTTP\ResponseMock();
skipping to change at line 315 skipping to change at line 315
{ {
$request = new HTTP\Request('POST', '/calendars/user1/cal1', ['Content-T ype' => 'text/xml']); $request = new HTTP\Request('POST', '/calendars/user1/cal1', ['Content-T ype' => 'text/xml']);
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:publish-calendar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" /> <cs:publish-calendar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" />
'; ';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(202, $response->status, $response->body); $this->assertEquals(202, $response->status, $response->getBodyAsString() );
} }
public function testUnpublish() public function testUnpublish()
{ {
$request = new HTTP\Request( $request = new HTTP\Request(
'POST', 'POST',
'/calendars/user1/cal1', '/calendars/user1/cal1',
['Content-Type' => 'text/xml'] ['Content-Type' => 'text/xml']
); );
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:unpublish-calendar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" / > <cs:unpublish-calendar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" / >
'; ';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(200, $response->status, $response->body); $this->assertEquals(200, $response->status, $response->getBodyAsString() );
} }
public function testPublishWrongUrl() public function testPublishWrongUrl()
{ {
$request = new HTTP\Request( $request = new HTTP\Request(
'POST', 'POST',
'/calendars/user1', '/calendars/user1',
['Content-Type' => 'text/xml'] ['Content-Type' => 'text/xml']
); );
skipping to change at line 382 skipping to change at line 382
'/calendars/user1/cal2', '/calendars/user1/cal2',
['Content-Type' => 'text/xml'] ['Content-Type' => 'text/xml']
); );
$xml = '<?xml version="1.0"?> $xml = '<?xml version="1.0"?>
<cs:foo-bar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" />'; <cs:foo-bar xmlns:cs="'.Plugin::NS_CALENDARSERVER.'" xmlns:d="DAV:" />';
$request->setBody($xml); $request->setBody($xml);
$response = $this->request($request); $response = $this->request($request);
$this->assertEquals(501, $response->status, $response->body); $this->assertEquals(501, $response->status, $response->getBodyAsString() );
} }
} }
 End of changes. 9 change blocks. 
9 lines changed or deleted 9 lines changed or added

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