]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/tests/Sabre/CalDAV/ServerTest.php
Initial Release of the calendar plugin
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CalDAV / ServerTest.php
diff --git a/dav/SabreDAV/tests/Sabre/CalDAV/ServerTest.php b/dav/SabreDAV/tests/Sabre/CalDAV/ServerTest.php
new file mode 100644 (file)
index 0000000..f00be7b
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+require_once 'Sabre/CalDAV/TestUtil.php';
+
+class Sabre_CalDAV_ServerTest extends PHPUnit_Framework_TestCase {
+
+    /**
+     * The CalDAV server is a simple script that just composes a
+     * Sabre_DAV_Server. All we really have to do is check if the setup
+     * is done correctly.
+     */
+    function testSetup() {
+
+        if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
+        $pdo = Sabre_CalDAV_TestUtil::getSQLiteDB();
+        $server = new Sabre_CalDAV_Server($pdo);
+
+        $authPlugin = $server->getPlugin('auth');
+        $this->assertTrue($authPlugin instanceof Sabre_DAV_Auth_Plugin);
+
+        $caldavPlugin = $server->getPlugin('caldav');
+        $this->assertTrue($caldavPlugin instanceof Sabre_CalDAV_Plugin);
+
+        $node = $server->tree->getNodeForPath('');
+        $this->assertTrue($node instanceof Sabre_DAV_SimpleCollection);
+
+        $this->assertEquals('root', $node->getName());
+
+    }
+
+}