diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php index c50f06986..4074259f2 100644 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php +++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Backend/PDOSqliteTest.php @@ -6,12 +6,24 @@ use Sabre\CalDAV; require_once 'Sabre/CalDAV/Backend/AbstractPDOTest.php'; -class PDOSQLiteTest extends AbstractPDOTest { +class PDOSqliteTest extends AbstractPDOTest { function setup() { if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available'); - $this->pdo = CalDAV\TestUtil::getSQLiteDB(); + + if (file_exists(SABRE_TEMPDIR . '/testdb.sqlite')) + unlink(SABRE_TEMPDIR . '/testdb.sqlite'); + + $pdo = new \PDO('sqlite:' . SABRE_TEMPDIR . '/testdb.sqlite'); + $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + + // Yup this is definitely not 'fool proof', but good enough for now. + $queries = explode(';', file_get_contents(__DIR__ . '/../../../../examples/sql/sqlite.calendars.sql')); + foreach ($queries as $query) { + $pdo->exec($query); + } + $this->pdo = $pdo; } |