[Pkg-owncloud-commits] [php-sabredav] 137/163: Tests.

David Prévot taffit at moszumanska.debian.org
Tue May 20 18:55:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag upstream/2.0.0_beta1
in repository php-sabredav.

commit 51991e3c696be04a5beb407763711d2cfdb205f5
Author: Evert Pot <me at evertpot.com>
Date:   Tue May 13 17:22:34 2014 -0400

    Tests.
---
 tests/Sabre/CalDAV/Subscriptions/PluginTest.php  | 15 +++++++++++++++
 tests/Sabre/CardDAV/SogoStripContentTypeTest.php | 13 +++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/tests/Sabre/CalDAV/Subscriptions/PluginTest.php b/tests/Sabre/CalDAV/Subscriptions/PluginTest.php
index 1a997b5..2e11d9a 100644
--- a/tests/Sabre/CalDAV/Subscriptions/PluginTest.php
+++ b/tests/Sabre/CalDAV/Subscriptions/PluginTest.php
@@ -2,6 +2,8 @@
 
 namespace Sabre\CalDAV\Subscriptions;
 
+use Sabre\DAV\PropFind;
+
 class PluginTest extends \PHPUnit_Framework_TestCase {
 
     function testInit() {
@@ -27,4 +29,17 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
 
     }
 
+    public function testPropFind() {
+
+        $propName = '{http://calendarserver.org/ns/}subscribed-strip-alarms';
+        $propFind = new PropFind('foo', [$propName]);
+        $propFind->set($propName,null,200);
+
+        $plugin = new Plugin();
+        $plugin->propFind($propFind, new \Sabre\DAV\SimpleCollection('hi'));
+
+        $this->assertFalse(is_null($propFind->get($propName)));
+
+    }
+
 }
diff --git a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
index 66f7dad..bbfa214 100644
--- a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
+++ b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
@@ -3,6 +3,7 @@
 namespace Sabre\CardDAV;
 
 use Sabre\HTTP;
+use Sabre\DAV\PropFind;
 
 class SogoStripContentType extends \Sabre\DAVServerTest {
 
@@ -39,5 +40,17 @@ class SogoStripContentType extends \Sabre\DAVServerTest {
         ), $result);
 
     }
+    function testDontTouchOtherMimeTypes() {
+
+        $this->server->httpRequest = new HTTP\Request('GET','/addressbooks/user1/book1/card1.vcf', [
+            'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 Lightning/1.2.1',
+        ]);
+
+        $propFind = new PropFind('hello', ['{DAV:}getcontenttype']);
+        $propFind->set('{DAV:}getcontenttype', 'text/plain');
+        $this->carddavPlugin->propFindLate($propFind, new \Sabre\DAV\SimpleCollection('foo'));
+        $this->assertEquals('text/plain', $propFind->get('{DAV:}getcontenttype'));
+
+    }
 
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list