ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CardDAV\PluginTest Class Reference
+ Inheritance diagram for Sabre\CardDAV\PluginTest:
+ Collaboration diagram for Sabre\CardDAV\PluginTest:

Public Member Functions

 testConstruct ()
 
 testSupportedReportSet ()
 
 testSupportedReportSetEmpty ()
 
 testAddressBookHomeSet ()
 
 testDirectoryGateway ()
 
 testReportPassThrough ()
 
 testHTMLActionsPanel ()
 
 testAddressbookPluginProperties ()
 
 testGetTransform ()
 
- Public Member Functions inherited from Sabre\CardDAV\AbstractPluginTest
 setUp ()
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\CardDAV\AbstractPluginTest
 $plugin
 
 $server
 
 $backend
 

Detailed Description

Definition at line 7 of file PluginTest.php.

Member Function Documentation

◆ testAddressBookHomeSet()

Sabre\CardDAV\PluginTest::testAddressBookHomeSet ( )

Definition at line 34 of file PluginTest.php.

References $result, and Sabre\CardDAV\Plugin\NS_CARDDAV.

34  {
35 
36  $result = $this->server->getProperties('principals/user1', ['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']);
37 
38  $this->assertEquals(1, count($result));
39  $this->assertTrue(isset($result['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']));
40  $this->assertEquals('addressbooks/user1/', $result['{' . Plugin::NS_CARDDAV . '}addressbook-home-set']->getHref());
41 
42  }
$result
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33

◆ testAddressbookPluginProperties()

Sabre\CardDAV\PluginTest::testAddressbookPluginProperties ( )

Definition at line 70 of file PluginTest.php.

References Sabre\CardDAV\Plugin\NS_CARDDAV.

70  {
71 
72  $ns = '{' . Plugin::NS_CARDDAV . '}';
73  $propFind = new DAV\PropFind('addressbooks/user1/book1', [
74  $ns . 'supported-address-data',
75  $ns . 'supported-collation-set',
76  ]);
77  $node = $this->server->tree->getNodeForPath('addressbooks/user1/book1');
78  $this->plugin->propFindEarly($propFind, $node);
79 
80  $this->assertInstanceOf(
81  'Sabre\\CardDAV\\Xml\\Property\\SupportedAddressData',
82  $propFind->get($ns . 'supported-address-data')
83  );
84  $this->assertInstanceOf(
85  'Sabre\\CardDAV\\Xml\\Property\\SupportedCollationSet',
86  $propFind->get($ns . 'supported-collation-set')
87  );
88 
89 
90  }
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33

◆ testConstruct()

Sabre\CardDAV\PluginTest::testConstruct ( )

Definition at line 9 of file PluginTest.php.

References Sabre\CardDAV\Plugin\NS_CARDDAV.

9  {
10 
11  $this->assertEquals('{' . Plugin::NS_CARDDAV . '}addressbook', $this->server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook']);
12 
13  $this->assertTrue(in_array('addressbook', $this->plugin->getFeatures()));
14  $this->assertEquals('carddav', $this->plugin->getPluginInfo()['name']);
15 
16  }
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33

◆ testDirectoryGateway()

Sabre\CardDAV\PluginTest::testDirectoryGateway ( )

Definition at line 44 of file PluginTest.php.

References $result, and Sabre\CardDAV\Plugin\NS_CARDDAV.

44  {
45 
46  $result = $this->server->getProperties('principals/user1', ['{' . Plugin::NS_CARDDAV . '}directory-gateway']);
47 
48  $this->assertEquals(1, count($result));
49  $this->assertTrue(isset($result['{' . Plugin::NS_CARDDAV . '}directory-gateway']));
50  $this->assertEquals(['directory'], $result['{' . Plugin::NS_CARDDAV . '}directory-gateway']->getHrefs());
51 
52  }
$result
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33

◆ testGetTransform()

Sabre\CardDAV\PluginTest::testGetTransform ( )

Definition at line 92 of file PluginTest.php.

References $request, and $response.

92  {
93 
94  $request = new \Sabre\HTTP\Request('GET', '/addressbooks/user1/book1/card1', ['Accept: application/vcard+json']);
95  $response = new \Sabre\HTTP\ResponseMock();
96  $this->server->invokeMethod($request, $response);
97 
98  $this->assertEquals(200, $response->getStatus());
99 
100  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
$response

◆ testHTMLActionsPanel()

Sabre\CardDAV\PluginTest::testHTMLActionsPanel ( )

Definition at line 60 of file PluginTest.php.

References Sabre\VObject\$output, and $r.

60  {
61 
62  $output = '';
63  $r = $this->server->emit('onHTMLActionsPanel', [$this->server->tree->getNodeForPath('addressbooks/user1'), &$output]);
64  $this->assertFalse($r);
65 
66  $this->assertTrue(!!strpos($output, 'Display name'));
67 
68  }
$r
Definition: example_031.php:79

◆ testReportPassThrough()

Sabre\CardDAV\PluginTest::testReportPassThrough ( )

Definition at line 54 of file PluginTest.php.

54  {
55 
56  $this->assertNull($this->plugin->report('{DAV:}foo', new \DomDocument(), ''));
57 
58  }

◆ testSupportedReportSet()

Sabre\CardDAV\PluginTest::testSupportedReportSet ( )

Definition at line 18 of file PluginTest.php.

References Sabre\CardDAV\Plugin\NS_CARDDAV.

18  {
19 
20  $this->assertEquals([
21  '{' . Plugin::NS_CARDDAV . '}addressbook-multiget',
22  '{' . Plugin::NS_CARDDAV . '}addressbook-query',
23  ], $this->plugin->getSupportedReportSet('addressbooks/user1/book1'));
24 
25  }
const NS_CARDDAV
xml namespace for CardDAV elements
Definition: Plugin.php:33

◆ testSupportedReportSetEmpty()

Sabre\CardDAV\PluginTest::testSupportedReportSetEmpty ( )

Definition at line 27 of file PluginTest.php.

27  {
28 
29  $this->assertEquals([
30  ], $this->plugin->getSupportedReportSet(''));
31 
32  }

The documentation for this class was generated from the following file: