mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 08:58:49 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
50
dav/SabreDAV/tests/Sabre/DAV/ServerFinderBlockTest.php
Normal file
50
dav/SabreDAV/tests/Sabre/DAV/ServerFinderBlockTest.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
require_once 'Sabre/HTTP/ResponseMock.php';
|
||||
require_once 'Sabre/DAV/AbstractServer.php';
|
||||
require_once 'Sabre/DAV/Exception.php';
|
||||
|
||||
class Sabre_DAV_ServerFinderBlockTest extends Sabre_DAV_AbstractServer{
|
||||
|
||||
function testPut() {
|
||||
|
||||
$serverVars = array(
|
||||
'REQUEST_URI' => '/testput.txt',
|
||||
'REQUEST_METHOD' => 'PUT',
|
||||
'HTTP_X_EXPECTED_ENTITY_LENGTH' => '20',
|
||||
);
|
||||
|
||||
$request = new Sabre_HTTP_Request($serverVars);
|
||||
$request->setBody('Testing finder');
|
||||
$this->server->httpRequest = $request;
|
||||
$this->server->exec();
|
||||
|
||||
$this->assertEquals('', $this->response->body);
|
||||
$this->assertEquals('HTTP/1.1 201 Created',$this->response->status);
|
||||
$this->assertEquals('0', $this->response->headers['Content-Length']);
|
||||
|
||||
$this->assertEquals('Testing finder',file_get_contents(SABRE_TEMPDIR . '/testput.txt'));
|
||||
|
||||
}
|
||||
|
||||
function testPutFail() {
|
||||
|
||||
$serverVars = array(
|
||||
'REQUEST_URI' => '/testput.txt',
|
||||
'REQUEST_METHOD' => 'PUT',
|
||||
'HTTP_X_EXPECTED_ENTITY_LENGTH' => '20',
|
||||
);
|
||||
|
||||
$request = new Sabre_HTTP_Request($serverVars);
|
||||
$request->setBody('');
|
||||
$this->server->httpRequest = $request;
|
||||
$this->server->exec();
|
||||
|
||||
$this->assertEquals('HTTP/1.1 403 Forbidden',$this->response->status);
|
||||
$this->assertEquals(array(
|
||||
'Content-Type' => 'application/xml; charset=utf-8',
|
||||
),$this->response->headers);
|
||||
|
||||
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/testput.txt'));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue