17 'principaluri' =>
'principals/user1',
22 "card1" =>
"BEGIN:VCARD\r\nFN:Person1\r\nEND:VCARD\r\n",
23 "card2" =>
"BEGIN:VCARD\r\nFN:Person2\r\nEND:VCARD",
24 "card3" =>
"BEGIN:VCARD\r\nFN:Person3\r\nEND:VCARD\r\n",
25 "card4" =>
"BEGIN:VCARD\nFN:Person4\nEND:VCARD\n",
33 $this->server->addPlugin(
41 $plugin = $this->server->getPlugin(
'vcf-export');
42 $this->assertInstanceOf(
'Sabre\\CardDAV\\VCFExportPlugin', $plugin);
46 $plugin->getPluginInfo()[
'name']
54 'REQUEST_URI' =>
'/addressbooks/user1/book1?export',
55 'QUERY_STRING' =>
'export',
56 'REQUEST_METHOD' =>
'GET',
62 $expected =
"BEGIN:VCARD 76 $expected = str_replace(
"\n",
"\r\n", $expected);
78 $this->assertEquals($expected,
$response->body);
84 $plugin = $this->server->getPlugin(
'vcf-export');
86 $addressbook =
new AddressBook($this->carddavBackend, []);
87 $this->server->emit(
'browserButtonActions', [
'/foo', $addressbook, &$actions]);
88 $this->assertContains(
'/foo?export', $actions);
96 '/addressbooks/user1/book1?export' 100 $this->assertEquals(
'text/directory',
$response->getHeader(
'Content-Type'));
102 'attachment; filename="book1-' . date(
'Y-m-d') .
'.vcf"',
103 $response->getHeader(
'Content-Disposition')
110 $this->carddavBackend->createAddressBook(
115 $this->carddavBackend->createCard(
118 "BEGIN:VCARD\r\nFN:Person1\r\nEND:VCARD\r\n" 123 '/addressbooks/user1/book-b_ad"(ch)ars?export' 127 $this->assertEquals(
'text/directory',
$response->getHeader(
'Content-Type'));
129 'attachment; filename="book-b_adchars-' . date(
'Y-m-d') .
'.vcf"',
130 $response->getHeader(
'Content-Disposition')
foreach($paths as $path) $request
testContentDispositionBadChars()
The AddressBook class represents a CardDAV addressbook, owned by a specific user. ...
This class may be used as a basis for other webdav-related unittests.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.