Definition at line 8 of file AbstractPDOTest.php.
◆ setUp()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::setUp |
( |
| ) |
|
Definition at line 12 of file AbstractPDOTest.php.
References $pdo, Sabre\DAV\createSchema(), Sabre\DAV\dropTables(), and Sabre\DAV\getPDO().
14 $this->
dropTables([
'principals',
'groupmembers']);
19 $pdo->query(
"INSERT INTO principals (uri,email,displayname) VALUES ('principals/user','user@example.org','User')");
20 $pdo->query(
"INSERT INTO principals (uri,email,displayname) VALUES ('principals/group','group@example.org','Group')");
22 $pdo->query(
"INSERT INTO groupmembers (principal_id,member_id) VALUES (5,4)");
dropTables($tableNames)
Drops tables, if they exist.
createSchema($schemaName)
Uses .sql files from the examples directory to initialize the database.
◆ testConstruct()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testConstruct |
( |
| ) |
|
◆ testFindByUri()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testFindByUri |
( |
| ) |
|
◆ testFindByUriUnknownScheme()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testFindByUriUnknownScheme |
( |
| ) |
|
◆ testGetGroupMemberSet()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testGetGroupMemberSet |
( |
| ) |
|
◆ testGetGroupMembership()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testGetGroupMembership |
( |
| ) |
|
◆ testGetPrincipalByPath()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testGetPrincipalByPath |
( |
| ) |
|
testConstruct
Definition at line 69 of file AbstractPDOTest.php.
References $pdo, and Sabre\DAV\getPDO().
76 'uri' =>
'principals/user',
77 '{http://sabredav.org/ns}email-address' =>
'user@example.org',
78 '{DAV:}displayname' =>
'User',
81 $this->assertEquals($expected, $backend->getPrincipalByPath(
'principals/user'));
82 $this->assertEquals(null, $backend->getPrincipalByPath(
'foo'));
◆ testGetPrincipalsByPrefix()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testGetPrincipalsByPrefix |
( |
| ) |
|
testConstruct
Definition at line 38 of file AbstractPDOTest.php.
References $pdo, and Sabre\DAV\getPDO().
45 'uri' =>
'principals/admin',
46 '{http://sabredav.org/ns}email-address' =>
'admin@example.org',
47 '{DAV:}displayname' =>
'Administrator',
50 'uri' =>
'principals/user',
51 '{http://sabredav.org/ns}email-address' =>
'user@example.org',
52 '{DAV:}displayname' =>
'User',
55 'uri' =>
'principals/group',
56 '{http://sabredav.org/ns}email-address' =>
'group@example.org',
57 '{DAV:}displayname' =>
'Group',
61 $this->assertEquals($expected, $backend->getPrincipalsByPrefix(
'principals'));
62 $this->assertEquals([], $backend->getPrincipalsByPrefix(
'foo'));
◆ testSearchPrincipals()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testSearchPrincipals |
( |
| ) |
|
Definition at line 125 of file AbstractPDOTest.php.
References $pdo, $result, and Sabre\DAV\getPDO().
131 $result = $backend->searchPrincipals(
'principals', [
'{DAV:}blabla' =>
'foo']);
132 $this->assertEquals([],
$result);
134 $result = $backend->searchPrincipals(
'principals', [
'{DAV:}displayname' =>
'ou']);
135 $this->assertEquals([
'principals/group'],
$result);
137 $result = $backend->searchPrincipals(
'principals', [
'{DAV:}displayname' =>
'UsEr',
'{http://sabredav.org/ns}email-address' =>
'USER@EXAMPLE']);
138 $this->assertEquals([
'principals/user'],
$result);
140 $result = $backend->searchPrincipals(
'mom', [
'{DAV:}displayname' =>
'UsEr',
'{http://sabredav.org/ns}email-address' =>
'USER@EXAMPLE']);
141 $this->assertEquals([],
$result);
◆ testSetGroupMemberSet()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testSetGroupMemberSet |
( |
| ) |
|
Definition at line 106 of file AbstractPDOTest.php.
References $pdo, and Sabre\DAV\getPDO().
112 $this->assertEquals([
'principals/user'], $backend->getGroupMemberSet(
'principals/group'));
115 $backend->setGroupMemberSet(
'principals/group', []);
116 $this->assertEquals([], $backend->getGroupMemberSet(
'principals/group'));
119 $backend->setGroupMemberSet(
'principals/group', [
'principals/user']);
120 $this->assertEquals([
'principals/user'], $backend->getGroupMemberSet(
'principals/group'));
◆ testUpdatePrincipal()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testUpdatePrincipal |
( |
| ) |
|
Definition at line 145 of file AbstractPDOTest.php.
References $pdo, $result, and Sabre\DAV\getPDO().
150 $propPatch =
new DAV\PropPatch([
151 '{DAV:}displayname' =>
'pietje',
154 $backend->updatePrincipal(
'principals/user', $propPatch);
155 $result = $propPatch->commit();
159 $this->assertEquals([
161 'uri' =>
'principals/user',
162 '{DAV:}displayname' =>
'pietje',
163 '{http://sabredav.org/ns}email-address' =>
'user@example.org',
164 ], $backend->getPrincipalByPath(
'principals/user'));
◆ testUpdatePrincipalUnknownField()
Sabre\DAVACL\PrincipalBackend\AbstractPDOTest::testUpdatePrincipalUnknownField |
( |
| ) |
|
Definition at line 168 of file AbstractPDOTest.php.
References $pdo, $result, and Sabre\DAV\getPDO().
173 $propPatch =
new DAV\PropPatch([
174 '{DAV:}displayname' =>
'pietje',
175 '{DAV:}unknown' =>
'foo',
178 $backend->updatePrincipal(
'principals/user', $propPatch);
179 $result = $propPatch->commit();
183 $this->assertEquals([
184 '{DAV:}displayname' => 424,
185 '{DAV:}unknown' => 403
186 ], $propPatch->getResult());
188 $this->assertEquals([
190 'uri' =>
'principals/user',
191 '{DAV:}displayname' =>
'User',
192 '{http://sabredav.org/ns}email-address' =>
'user@example.org',
193 ], $backend->getPrincipalByPath(
'principals/user'));
The documentation for this class was generated from the following file: