diff options
author | Mario <mario@mariovavti.com> | 2019-11-10 12:49:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-10 14:10:03 +0100 |
commit | 580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch) | |
tree | 82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php | |
parent | d22766f458a8539a40a57f3946459a9be1f21cd6 (diff) | |
download | volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2 volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip |
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php | 65 |
1 files changed, 30 insertions, 35 deletions
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 @@ <?php +declare(strict_types=1); + namespace Sabre\CardDAV; use Sabre\HTTP; -class VCFExportTest extends \Sabre\DAVServerTest { - +class VCFExportTest extends \Sabre\DAVServerTest +{ protected $setupCardDAV = true; protected $autoLogin = 'user1'; protected $setupACL = true; protected $carddavAddressBooks = [ [ - 'id' => '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') ); - } - } |