]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
8cbc42012a5dadf23c2708f6178cf4ece36257d1
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CardDAV / SogoStripContentTypeTest.php
1 <?php
2
3 class Sabre_CardDAV_SogoStripContentType extends Sabre_DAVServerTest {
4
5     protected $setupCardDAV = true;
6     protected $carddavAddressBooks = array(
7         array(
8             'id'  => 1,
9             'uri' => 'book1',
10             'principaluri' => 'principals/user1',
11         ),
12     );
13     protected $carddavCards = array(
14         1 => array(
15             'card1.vcf' => "BEGIN:VCARD\nVERSION:3.0\nUID:12345\nEND:VCARD",
16         ),
17     );
18
19     function testDontStrip() {
20
21         $result = $this->server->getProperties('addressbooks/user1/book1/card1.vcf',array('{DAV:}getcontenttype'));
22         $this->assertEquals(array(
23             '{DAV:}getcontenttype' => 'text/x-vcard; charset=utf-8'
24         ), $result);
25
26     }
27     function testStrip() {
28
29         $this->server->httpRequest = new Sabre_HTTP_Request(array(
30             'HTTP_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',
31         ));
32         $result = $this->server->getProperties('addressbooks/user1/book1/card1.vcf',array('{DAV:}getcontenttype'));
33         $this->assertEquals(array(
34             '{DAV:}getcontenttype' => 'text/x-vcard'
35         ), $result);
36
37     }
38
39 }