]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/tests/Sabre/DAV/ServerEventsTest.php
Heavily refactored, including multiple calendars per user and recurring events. Not...
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / DAV / ServerEventsTest.php
index a5e88f3a8cfabec3c3f12f3ac5eef657b0396ee3..7208fed2b8d1fd855cb923c92e04cb6079b21bbe 100644 (file)
@@ -6,6 +6,8 @@ class Sabre_DAV_ServerEventsTest extends Sabre_DAV_AbstractServer {
 
     private $tempPath;
 
+    private $exception;
+
     function testAfterBind() {
 
         $this->server->subscribeEvent('afterBind',array($this,'afterBindHandler'));
@@ -47,5 +49,25 @@ class Sabre_DAV_ServerEventsTest extends Sabre_DAV_AbstractServer {
 
     }
 
+    function testException() {
+
+        $this->server->subscribeEvent('exception', array($this, 'exceptionHandler'));
+
+        $req = new Sabre_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;
+
+    }
 
 }