Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820311
PDOSqliteTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
PDOSqliteTest.php
View Options
<?php
namespace
Sabre\DAVACL\PrincipalBackend
;
use
Sabre\DAV
;
use
Sabre\HTTP
;
require_once
'Sabre/DAV/Auth/Backend/AbstractPDOTest.php'
;
class
PDOSQLiteTest
extends
AbstractPDOTest
{
function
tearDown
()
{
if
(
file_exists
(
SABRE_TEMPDIR
.
'/pdobackend'
))
unlink
(
SABRE_TEMPDIR
.
'/pdobackend'
);
if
(
file_exists
(
SABRE_TEMPDIR
.
'/pdobackend2'
))
unlink
(
SABRE_TEMPDIR
.
'/pdobackend2'
);
}
function
getPDO
()
{
if
(!
SABRE_HASSQLITE
)
$this
->
markTestSkipped
(
'SQLite driver is not available'
);
$pdo
=
new
\PDO
(
'sqlite:'
.
SABRE_TEMPDIR
.
'/pdobackend'
);
$pdo
->
setAttribute
(
\PDO
::
ATTR_ERRMODE
,
\PDO
::
ERRMODE_EXCEPTION
);
$pdo
->
query
(
'CREATE TABLE principals (id INTEGER PRIMARY KEY ASC, uri TEXT, email VARCHAR(80), displayname VARCHAR(80))'
);
$pdo
->
query
(
'INSERT INTO principals VALUES (1, "principals/user","user@example.org","User")'
);
$pdo
->
query
(
'INSERT INTO principals VALUES (2, "principals/group","group@example.org","Group")'
);
$pdo
->
query
(
"CREATE TABLE groupmembers (
id INTEGER PRIMARY KEY ASC,
principal_id INT,
member_id INT,
UNIQUE(principal_id, member_id)
);"
);
$pdo
->
query
(
"INSERT INTO groupmembers (principal_id,member_id) VALUES (2,1)"
);
return
$pdo
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Dec 22, 1:06 AM (6 d, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914489
Default Alt Text
PDOSqliteTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment