aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php91
1 files changed, 45 insertions, 46 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php
index 6962e7830..b5a68dc48 100644
--- a/vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/PluginTest.php
@@ -1,102 +1,101 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CardDAV;
use Sabre\DAV;
-class PluginTest extends AbstractPluginTest {
-
- function testConstruct() {
-
- $this->assertEquals('{' . Plugin::NS_CARDDAV . '}addressbook', $this->server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook']);
+class PluginTest extends AbstractPluginTest
+{
+ public function testConstruct()
+ {
+ $this->assertEquals('{'.Plugin::NS_CARDDAV.'}addressbook', $this->server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook']);
$this->assertTrue(in_array('addressbook', $this->plugin->getFeatures()));
$this->assertEquals('carddav', $this->plugin->getPluginInfo()['name']);
-
}
- function testSupportedReportSet() {
-
+ public function testSupportedReportSet()
+ {
$this->assertEquals([
- '{' . Plugin::NS_CARDDAV . '}addressbook-multiget',
- '{' . Plugin::NS_CARDDAV . '}addressbook-query',
+ '{'.Plugin::NS_CARDDAV.'}addressbook-multiget',
+ '{'.Plugin::NS_CARDDAV.'}addressbook-query',
], $this->plugin->getSupportedReportSet('addressbooks/user1/book1'));
-
}
- function testSupportedReportSetEmpty() {
-
+ public function testSupportedReportSetEmpty()
+ {
$this->assertEquals([
], $this->plugin->getSupportedReportSet(''));
-
}
- function testAddressBookHomeSet() {
-
- $result = $this->server->getProperties('principals/user1', ['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']);
+ public function testAddressBookHomeSet()
+ {
+ $result = $this->server->getProperties('principals/user1', ['{'.Plugin::NS_CARDDAV.'}addressbook-home-set']);
$this->assertEquals(1, count($result));
- $this->assertTrue(isset($result['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']));
- $this->assertEquals('addressbooks/user1/', $result['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']->getHref());
-
+ $this->assertTrue(isset($result['{'.Plugin::NS_CARDDAV.'}addressbook-home-set']));
+ $this->assertEquals('addressbooks/user1/', $result['{'.Plugin::NS_CARDDAV.'}addressbook-home-set']->getHref());
}
- function testDirectoryGateway() {
-
- $result = $this->server->getProperties('principals/user1', ['{' . Plugin::NS_CARDDAV . '}directory-gateway']);
+ public function testDirectoryGateway()
+ {
+ $result = $this->server->getProperties('principals/user1', ['{'.Plugin::NS_CARDDAV.'}directory-gateway']);
$this->assertEquals(1, count($result));
- $this->assertTrue(isset($result['{' . Plugin::NS_CARDDAV . '}directory-gateway']));
- $this->assertEquals(['directory'], $result['{' . Plugin::NS_CARDDAV . '}directory-gateway']->getHrefs());
-
+ $this->assertTrue(isset($result['{'.Plugin::NS_CARDDAV.'}directory-gateway']));
+ $this->assertEquals(['directory'], $result['{'.Plugin::NS_CARDDAV.'}directory-gateway']->getHrefs());
}
- function testReportPassThrough() {
-
+ public function testReportPassThrough()
+ {
$this->assertNull($this->plugin->report('{DAV:}foo', new \DomDocument(), ''));
-
}
- function testHTMLActionsPanel() {
-
+ public function testHTMLActionsPanel()
+ {
$output = '';
$r = $this->server->emit('onHTMLActionsPanel', [$this->server->tree->getNodeForPath('addressbooks/user1'), &$output]);
$this->assertFalse($r);
- $this->assertTrue(!!strpos($output, 'Display name'));
-
+ $this->assertTrue((bool) strpos($output, 'Display name'));
}
- function testAddressbookPluginProperties() {
-
- $ns = '{' . Plugin::NS_CARDDAV . '}';
+ public function testAddressbookPluginProperties()
+ {
+ $ns = '{'.Plugin::NS_CARDDAV.'}';
$propFind = new DAV\PropFind('addressbooks/user1/book1', [
- $ns . 'supported-address-data',
- $ns . 'supported-collation-set',
+ $ns.'supported-address-data',
+ $ns.'supported-collation-set',
]);
$node = $this->server->tree->getNodeForPath('addressbooks/user1/book1');
$this->plugin->propFindEarly($propFind, $node);
$this->assertInstanceOf(
'Sabre\\CardDAV\\Xml\\Property\\SupportedAddressData',
- $propFind->get($ns . 'supported-address-data')
+ $propFind->get($ns.'supported-address-data')
);
$this->assertInstanceOf(
'Sabre\\CardDAV\\Xml\\Property\\SupportedCollationSet',
- $propFind->get($ns . 'supported-collation-set')
+ $propFind->get($ns.'supported-collation-set')
);
-
-
}
- function testGetTransform() {
-
- $request = new \Sabre\HTTP\Request('GET', '/addressbooks/user1/book1/card1', ['Accept: application/vcard+json']);
+ public function testGetTransform()
+ {
+ $request = new \Sabre\HTTP\Request('GET', '/addressbooks/user1/book1/card1', ['Accept' => 'application/vcard+json']);
$response = new \Sabre\HTTP\ResponseMock();
$this->server->invokeMethod($request, $response);
$this->assertEquals(200, $response->getStatus());
-
}
+ public function testGetWithoutContentType()
+ {
+ $request = new \Sabre\HTTP\Request('GET', '/');
+ $response = new \Sabre\HTTP\ResponseMock();
+ $this->plugin->httpAfterGet($request, $response);
+ $this->assertTrue(true);
+ }
}