1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Arsse/tests/cases/Db/SQLite3PDO/TestDriver.php

36 lines
1.2 KiB
PHP
Raw Normal View History

<?php
/** @license MIT
* Copyright 2017 J. King, Dustin Wilson et al.
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
2017-12-22 16:45:24 +00:00
namespace JKingWeb\Arsse\TestCase\Db\SQLite3PDO;
/**
* @covers \JKingWeb\Arsse\Db\SQLite3\PDODriver<extended>
* @covers \JKingWeb\Arsse\Db\PDODriver
* @covers \JKingWeb\Arsse\Db\PDOError
* @covers \JKingWeb\Arsse\Db\SQLState */
class TestDriver extends \JKingWeb\Arsse\TestCase\Db\BaseDriver {
use \JKingWeb\Arsse\Test\DatabaseDrivers\SQLite3PDO;
protected $create = "CREATE TABLE arsse_test(id integer primary key)";
protected $lock = "BEGIN EXCLUSIVE TRANSACTION";
protected $setVersion = "PRAGMA user_version=#";
protected static $file;
public static function setUpBeforeClass() {
// create a temporary database file rather than using a memory database
// some tests require one connection to block another, so a memory database is not suitable
static::$file = tempnam(sys_get_temp_dir(), 'ook');
static::$conf['dbSQLite3File'] = static::$file;
parent::setUpBeforeclass();
}
public static function tearDownAfterClass() {
parent::tearDownAfterClass();
@unlink(self::$file);
self::$file = null;
}
}