1<?php 2 3namespace Sabre\DAV\Locks\Backend; 4 5require_once 'Sabre/TestUtil.php'; 6require_once 'Sabre/DAV/Locks/Backend/AbstractTest.php'; 7 8class PDOTest extends AbstractTest { 9 10 function getBackend() { 11 12 if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available'); 13 \Sabre\TestUtil::clearTempDir(); 14 mkdir(SABRE_TEMPDIR . '/pdolocks'); 15 $pdo = new \PDO('sqlite:' . SABRE_TEMPDIR . '/pdolocks/db.sqlite'); 16 $pdo->setAttribute(\PDO::ATTR_ERRMODE,\PDO::ERRMODE_EXCEPTION); 17 $pdo->query('CREATE TABLE locks ( id integer primary key asc, owner text, timeout text, created integer, token text, scope integer, depth integer, uri text)'); 18 $backend = new PDO($pdo); 19 return $backend; 20 21 } 22 23 function tearDown() { 24 25 \Sabre\TestUtil::clearTempDir(); 26 27 } 28 29} 30