Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1819302
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\CardDAV\Backend
;
require_once
'Sabre/TestUtil.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'
);
}
/**
* @return PDO
*/
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
(
"DROP TABLE IF EXISTS addressbooks"
);
$pdo
->
query
(
"DROP TABLE IF EXISTS addressbookchanges"
);
$pdo
->
query
(
"DROP TABLE IF EXISTS cards"
);
$queries
=
explode
(
';'
,
file_get_contents
(
__DIR__
.
'/../../../../examples/sql/sqlite.addressbooks.sql'
)
);
foreach
(
$queries
as
$query
)
{
$query
=
trim
(
$query
,
"
\r\n\t
"
);
if
(
$query
)
$pdo
->
exec
(
$query
);
}
return
$pdo
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Dec 21, 11:04 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914169
Default Alt Text
PDOSqliteTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment