mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-23 22:43:40 +00:00
28 lines
868 B
PHP
28 lines
868 B
PHP
|
<?php
|
||
|
|
||
|
require_once 'Sabre/TestUtil.php';
|
||
|
require_once 'Sabre/DAV/Locks/Backend/AbstractTest.php';
|
||
|
|
||
|
class Sabre_DAV_Locks_Backend_PDOTest extends Sabre_DAV_Locks_Backend_AbstractTest {
|
||
|
|
||
|
function getBackend() {
|
||
|
|
||
|
if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
|
||
|
Sabre_TestUtil::clearTempDir();
|
||
|
mkdir(SABRE_TEMPDIR . '/pdolocks');
|
||
|
$pdo = new PDO('sqlite:' . SABRE_TEMPDIR . '/pdolocks/db.sqlite');
|
||
|
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
||
|
$pdo->query('CREATE TABLE locks ( id integer primary key asc, owner text, timeout text, created integer, token text, scope integer, depth integer, uri text)');
|
||
|
$backend = new Sabre_DAV_Locks_Backend_PDO($pdo);
|
||
|
return $backend;
|
||
|
|
||
|
}
|
||
|
|
||
|
function tearDown() {
|
||
|
|
||
|
Sabre_TestUtil::clearTempDir();
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|