Definition at line 7 of file VCFExportTest.php.
◆ setUp()
Sabre\CardDAV\VCFExportTest::setUp |
( |
| ) |
|
Reimplemented from Sabre\DAVServerTest.
Definition at line 29 of file VCFExportTest.php.
29 {
30
31 parent::setUp();
32 $plugin = new VCFExportPlugin();
33 $this->server->addPlugin(
34 $plugin
35 );
36
37 }
◆ testBrowserIntegration()
Sabre\CardDAV\VCFExportTest::testBrowserIntegration |
( |
| ) |
|
Definition at line 82 of file VCFExportTest.php.
82 {
83
84 $plugin = $this->server->getPlugin('vcf-export');
85 $actions = '';
86 $addressbook = new AddressBook($this->carddavBackend, []);
87 $this->server->emit('browserButtonActions', ['/foo', $addressbook, &$actions]);
88 $this->assertContains('/foo?export', $actions);
89
90 }
◆ testContentDisposition()
Sabre\CardDAV\VCFExportTest::testContentDisposition |
( |
| ) |
|
Definition at line 92 of file VCFExportTest.php.
92 {
93
95 'GET',
96 '/addressbooks/user1/book1?export'
97 );
98
100 $this->assertEquals(
'text/directory',
$response->getHeader(
'Content-Type'));
101 $this->assertEquals(
102 'attachment; filename="book1-' . date('Y-m-d') . '.vcf"',
103 $response->getHeader(
'Content-Disposition')
104 );
105
106 }
foreach($paths as $path) $request
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
References $request, $response, and Sabre\DAVServerTest\request().
◆ testContentDispositionBadChars()
Sabre\CardDAV\VCFExportTest::testContentDispositionBadChars |
( |
| ) |
|
Definition at line 108 of file VCFExportTest.php.
108 {
109
110 $this->carddavBackend->createAddressBook(
111 'principals/user1',
112 'book-b_ad"(ch)ars',
113 []
114 );
115 $this->carddavBackend->createCard(
116 'book-b_ad"(ch)ars',
117 'card1',
118 "BEGIN:VCARD\r\nFN:Person1\r\nEND:VCARD\r\n"
119 );
120
122 'GET',
123 '/addressbooks/user1/book-b_ad"(ch)ars?export'
124 );
125
127 $this->assertEquals(
'text/directory',
$response->getHeader(
'Content-Type'));
128 $this->assertEquals(
129 'attachment; filename="book-b_adchars-' . date('Y-m-d') . '.vcf"',
130 $response->getHeader(
'Content-Disposition')
131 );
132
133 }
References $request, $response, and Sabre\DAVServerTest\request().
◆ testExport()
Sabre\CardDAV\VCFExportTest::testExport |
( |
| ) |
|
Definition at line 51 of file VCFExportTest.php.
51 {
52
54 'REQUEST_URI' => '/addressbooks/user1/book1?export',
55 'QUERY_STRING' => 'export',
56 'REQUEST_METHOD' => 'GET',
57 ]);
58
61
62 $expected = "BEGIN:VCARD
63FN:Person1
64END:VCARD
65BEGIN:VCARD
66FN:Person2
67END:VCARD
68BEGIN:VCARD
69FN:Person3
70END:VCARD
71BEGIN:VCARD
72FN:Person4
73END:VCARD
74";
75
76 $expected = str_replace("\n", "\r\n", $expected);
77
78 $this->assertEquals($expected,
$response->body);
79
80 }
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().
◆ testSimple()
Sabre\CardDAV\VCFExportTest::testSimple |
( |
| ) |
|
Definition at line 39 of file VCFExportTest.php.
39 {
40
41 $plugin = $this->server->getPlugin('vcf-export');
42 $this->assertInstanceOf('Sabre\\CardDAV\\VCFExportPlugin', $plugin);
43
44 $this->assertEquals(
45 'vcf-export',
46 $plugin->getPluginInfo()['name']
47 );
48
49 }
◆ $autoLogin
Sabre\CardDAV\VCFExportTest::$autoLogin = 'user1' |
|
protected |
◆ $carddavAddressBooks
Sabre\CardDAV\VCFExportTest::$carddavAddressBooks |
|
protected |
Initial value:= [
[
'id' => 'book1',
'uri' => 'book1',
'principaluri' => 'principals/user1',
]
]
Definition at line 13 of file VCFExportTest.php.
◆ $carddavCards
Sabre\CardDAV\VCFExportTest::$carddavCards |
|
protected |
Initial value:= [
'book1' => [
"card1" => "BEGIN:VCARD\r\nFN:Person1\r\nEND:VCARD\r\n",
"card2" => "BEGIN:VCARD\r\nFN:Person2\r\nEND:VCARD",
"card3" => "BEGIN:VCARD\r\nFN:Person3\r\nEND:VCARD\r\n",
"card4" => "BEGIN:VCARD\nFN:Person4\nEND:VCARD\n",
]
]
Definition at line 20 of file VCFExportTest.php.
◆ $setupACL
Sabre\CardDAV\VCFExportTest::$setupACL = true |
|
protected |
◆ $setupCardDAV
Sabre\CardDAV\VCFExportTest::$setupCardDAV = true |
|
protected |
The documentation for this class was generated from the following file: