Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1816683
PDOMySQLTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
PDOMySQLTest.php
View Options
<?php
namespace
Sabre\DAVACL\PrincipalBackend
;
use
Sabre\DAV
;
use
Sabre\HTTP
;
require_once
'Sabre/TestUtil.php'
;
class
PDOMySQLTest
extends
AbstractPDOTest
{
function
getPDO
()
{
if
(!
SABRE_HASMYSQL
)
$this
->
markTestSkipped
(
'MySQL driver is not available, or not properly configured'
);
$pdo
=
\Sabre\TestUtil
::
getMySQLDB
();
if
(!
$pdo
)
$this
->
markTestSkipped
(
'Could not connect to MySQL database'
);
$pdo
->
query
(
"DROP TABLE IF EXISTS principals"
);
$pdo
->
query
(
"
create table principals (
id integer unsigned not null primary key auto_increment,
uri varchar(50),
email varchar(80),
displayname VARCHAR(80),
vcardurl VARCHAR(80),
unique(uri)
);"
);
$pdo
->
query
(
"INSERT INTO principals (uri,email,displayname) VALUES ('principals/user','user@example.org','User')"
);
$pdo
->
query
(
"INSERT INTO principals (uri,email,displayname) VALUES ('principals/group','group@example.org','Group')"
);
$pdo
->
query
(
"DROP TABLE IF EXISTS groupmembers"
);
$pdo
->
query
(
"CREATE TABLE groupmembers (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
principal_id INTEGER UNSIGNED NOT NULL,
member_id INTEGER UNSIGNED NOT NULL,
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
Fri, Dec 20, 4:47 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914159
Default Alt Text
PDOMySQLTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment