From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 10 May 2016 17:26:44 -0700 Subject: initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) --- .../dav/tests/Sabre/CardDAV/VCFExportTest.php | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 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 84da59311..71fde719d 100644 --- a/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php +++ b/vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php @@ -29,28 +29,35 @@ class VCFExportTest extends \Sabre\DAVServerTest { function setUp() { parent::setUp(); + $plugin = new VCFExportPlugin(); $this->server->addPlugin( - new VCFExportPlugin() + $plugin ); } function testSimple() { - $this->assertInstanceOf('Sabre\\CardDAV\\VCFExportPlugin', $this->server->getPlugin('Sabre\\CardDAV\\VCFExportPlugin')); + $plugin = $this->server->getPlugin('vcf-export'); + $this->assertInstanceOf('Sabre\\CardDAV\\VCFExportPlugin', $plugin); + + $this->assertEquals( + 'vcf-export', + $plugin->getPluginInfo()['name'] + ); } function testExport() { - $request = new HTTP\Request(array( + $request = HTTP\Sapi::createFromServerArray(array( 'REQUEST_URI' => '/addressbooks/user1/book1?export', 'QUERY_STRING' => 'export', 'REQUEST_METHOD' => 'GET', )); $response = $this->request($request); - $this->assertEquals('HTTP/1.1 200 OK', $response->status, $response->body); + $this->assertEquals(200, $response->status, $response->body); $expected = "BEGIN:VCARD FN:Person1 @@ -72,4 +79,14 @@ END:VCARD } + 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); + + } + } -- cgit v1.2.3