diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CardDAV/VCFExportTest.php | 25 |
1 files changed, 21 insertions, 4 deletions
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); + + } + } |