mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-08 09:28: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
51
dav/SabreDAV/tests/Sabre/DAV/ServerEventsTest.php
Normal file
51
dav/SabreDAV/tests/Sabre/DAV/ServerEventsTest.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
require_once 'Sabre/DAV/AbstractServer.php';
|
||||
|
||||
class Sabre_DAV_ServerEventsTest extends Sabre_DAV_AbstractServer {
|
||||
|
||||
private $tempPath;
|
||||
|
||||
function testAfterBind() {
|
||||
|
||||
$this->server->subscribeEvent('afterBind',array($this,'afterBindHandler'));
|
||||
$newPath = 'afterBind';
|
||||
|
||||
$this->tempPath = '';
|
||||
$this->server->createFile($newPath,'body');
|
||||
$this->assertEquals($newPath, $this->tempPath);
|
||||
|
||||
}
|
||||
|
||||
function afterBindHandler($path) {
|
||||
|
||||
$this->tempPath = $path;
|
||||
|
||||
}
|
||||
|
||||
function testBeforeBindCancel() {
|
||||
|
||||
$this->server->subscribeEvent('beforeBind', array($this,'beforeBindCancelHandler'));
|
||||
$this->assertFalse($this->server->createFile('bla','body'));
|
||||
|
||||
// Also testing put()
|
||||
$req = new Sabre_HTTP_Request(array(
|
||||
'REQUEST_METHOD' => 'PUT',
|
||||
'REQUEST_URI' => '/foobar',
|
||||
));
|
||||
|
||||
$this->server->httpRequest = $req;
|
||||
$this->server->exec();
|
||||
|
||||
$this->assertEquals('',$this->server->httpResponse->status);
|
||||
|
||||
}
|
||||
|
||||
function beforeBindCancelHandler() {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue