mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-13 10:09:27 +00:00
0bc0a09bf4
- application/extensions file system permission now is 775 - application/logs file system permission now is 775 - Added extensions directory in application/: config, controllers, helpers, hooks, libraries, models, views and widgets - Added view views/extensions/manage.php - Added controller controllers/system/extensions/Manager.php - Added library ExtensionsLib to manage extensions - Added model models/system/Extensions_model.php - Moved code related to print out info from MigrationLib to EPrintfLib
77 lines
1.6 KiB
PHP
77 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Sabre\DAV;
|
|
use Sabre\HTTP;
|
|
|
|
require_once 'Sabre/DAV/AbstractServer.php';
|
|
|
|
class ServerEventsTest extends AbstractServer {
|
|
|
|
private $tempPath;
|
|
|
|
private $exception;
|
|
|
|
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 HTTP\Request(array(
|
|
'REQUEST_METHOD' => 'PUT',
|
|
'REQUEST_URI' => '/barbar',
|
|
));
|
|
|
|
$this->server->httpRequest = $req;
|
|
$this->server->exec();
|
|
|
|
$this->assertEquals('',$this->server->httpResponse->status);
|
|
|
|
}
|
|
|
|
function beforeBindCancelHandler() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
function testException() {
|
|
|
|
$this->server->subscribeEvent('exception', array($this, 'exceptionHandler'));
|
|
|
|
$req = new HTTP\Request(array(
|
|
'REQUEST_METHOD' => 'GET',
|
|
'REQUEST_URI' => '/not/exisitng',
|
|
));
|
|
$this->server->httpRequest = $req;
|
|
$this->server->exec();
|
|
|
|
$this->assertInstanceOf('Sabre\\DAV\\Exception\\NotFound', $this->exception);
|
|
|
|
}
|
|
|
|
function exceptionHandler(Exception $exception) {
|
|
|
|
$this->exception = $exception;
|
|
|
|
}
|
|
|
|
}
|