[Pkg-owncloud-commits] [php-sabredav] 139/220: Add tests

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:18 UTC 2016


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

taffit pushed a commit to branch master
in repository php-sabredav.

commit 80203e177aff77306e1a4b3afcee5ad8c63b1d25
Author: Robin McCorkell <robin at mccorkell.me.uk>
Date:   Sun Apr 10 20:10:32 2016 +0100

    Add tests
---
 tests/Sabre/CardDAV/VCFExportTest.php | 43 +++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/tests/Sabre/CardDAV/VCFExportTest.php b/tests/Sabre/CardDAV/VCFExportTest.php
index 2863a2e..82d82fa 100644
--- a/tests/Sabre/CardDAV/VCFExportTest.php
+++ b/tests/Sabre/CardDAV/VCFExportTest.php
@@ -89,4 +89,47 @@ END:VCARD
 
     }
 
+    function testContentDisposition() {
+
+        $request = new HTTP\Request(
+            'GET',
+            '/addressbooks/user1/book1?export'
+        );
+
+        $response = $this->request($request, 200);
+        $this->assertEquals('text/directory', $response->getHeader('Content-Type'));
+        $this->assertEquals(
+            'attachment; filename="book1-' . date('Y-m-d') . '.vcf"',
+            $response->getHeader('Content-Disposition')
+        );
+
+    }
+
+    function testContentDispositionBadChars() {
+
+        $this->carddavBackend->createAddressBook(
+            'principals/user1',
+            'book-b_ad"(ch)ars',
+            []
+        );
+        $this->carddavBackend->createCard(
+            'book-b_ad"(ch)ars',
+            'card1',
+            "BEGIN:VCARD\r\nFN:Person1\r\nEND:VCARD\r\n"
+        );
+
+        $request = new HTTP\Request(
+            'GET',
+            '/addressbooks/user1/book-b_ad"(ch)ars?export'
+        );
+
+        $response = $this->request($request, 200);
+        $this->assertEquals('text/directory', $response->getHeader('Content-Type'));
+        $this->assertEquals(
+            'attachment; filename="book-b_adchars-' . date('Y-m-d') . '.vcf"',
+            $response->getHeader('Content-Disposition')
+        );
+
+    }
+
 }

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



More information about the Pkg-owncloud-commits mailing list