From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../dav/tests/Sabre/CardDAV/VCFExportTest.php | 65 ++++++++++------------ 1 file changed, 30 insertions(+), 35 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php index 82d82fadd..d8acc3c14 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php @@ -1,43 +1,44 @@ 'book1', - 'uri' => 'book1', + 'id' => 'book1', + 'uri' => 'book1', 'principaluri' => 'principals/user1', - ] + ], ]; protected $carddavCards = [ '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", - ] + '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", + ], ]; - function setUp() { - + public function setUp() + { parent::setUp(); $plugin = new VCFExportPlugin(); $this->server->addPlugin( $plugin ); - } - function testSimple() { - + public function testSimple() + { $plugin = $this->server->getPlugin('vcf-export'); $this->assertInstanceOf('Sabre\\CardDAV\\VCFExportPlugin', $plugin); @@ -45,21 +46,20 @@ class VCFExportTest extends \Sabre\DAVServerTest { 'vcf-export', $plugin->getPluginInfo()['name'] ); - } - function testExport() { - + public function testExport() + { $request = HTTP\Sapi::createFromServerArray([ - 'REQUEST_URI' => '/addressbooks/user1/book1?export', - 'QUERY_STRING' => 'export', + 'REQUEST_URI' => '/addressbooks/user1/book1?export', + 'QUERY_STRING' => 'export', 'REQUEST_METHOD' => 'GET', ]); $response = $this->request($request); $this->assertEquals(200, $response->status, $response->body); - $expected = "BEGIN:VCARD + $expected = 'BEGIN:VCARD FN:Person1 END:VCARD BEGIN:VCARD @@ -71,26 +71,24 @@ END:VCARD BEGIN:VCARD FN:Person4 END:VCARD -"; +'; // We actually expected windows line endings $expected = str_replace("\n", "\r\n", $expected); $this->assertEquals($expected, $response->body); - } - function testBrowserIntegration() { - + public function testBrowserIntegration() + { $plugin = $this->server->getPlugin('vcf-export'); $actions = ''; $addressbook = new AddressBook($this->carddavBackend, []); $this->server->emit('browserButtonActions', ['/foo', $addressbook, &$actions]); $this->assertContains('/foo?export', $actions); - } - function testContentDisposition() { - + public function testContentDisposition() + { $request = new HTTP\Request( 'GET', '/addressbooks/user1/book1?export' @@ -99,14 +97,13 @@ END:VCARD $response = $this->request($request, 200); $this->assertEquals('text/directory', $response->getHeader('Content-Type')); $this->assertEquals( - 'attachment; filename="book1-' . date('Y-m-d') . '.vcf"', + 'attachment; filename="book1-'.date('Y-m-d').'.vcf"', $response->getHeader('Content-Disposition') ); - } - function testContentDispositionBadChars() { - + public function testContentDispositionBadChars() + { $this->carddavBackend->createAddressBook( 'principals/user1', 'book-b_ad"(ch)ars', @@ -126,10 +123,8 @@ END:VCARD $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"', + 'attachment; filename="book-b_adchars-'.date('Y-m-d').'.vcf"', $response->getHeader('Content-Disposition') ); - } - } -- cgit v1.2.3