2017-03-02 03:47:51 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace JKingWeb\NewsSync;
|
|
|
|
|
|
|
|
|
|
|
|
class TestDbStatementSQLite3 extends \PHPUnit\Framework\TestCase {
|
2017-03-02 23:42:19 +00:00
|
|
|
use Test\Tools, Test\Db\BindingTests;
|
2017-03-02 03:47:51 +00:00
|
|
|
|
|
|
|
protected $c;
|
|
|
|
protected $s;
|
2017-03-02 23:42:19 +00:00
|
|
|
static protected $imp = Db\StatementSQLite3::class;
|
2017-03-02 03:47:51 +00:00
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
date_default_timezone_set("UTC");
|
|
|
|
$c = new \SQLite3(":memory:");
|
|
|
|
$c->enableExceptions(true);
|
|
|
|
$s = $c->prepare("SELECT ? as value");
|
|
|
|
$this->c = $c;
|
|
|
|
$this->s = $s;
|
|
|
|
}
|
|
|
|
|
|
|
|
function tearDown() {
|
|
|
|
try {$this->s->close();} catch(\Exception $e) {}
|
|
|
|
$this->c->close();
|
|
|
|
unset($this->s);
|
|
|
|
unset($this->c);
|
|
|
|
}
|
|
|
|
|
|
|
|
function testConstructStatement() {
|
|
|
|
$this->assertInstanceOf(Db\StatementSQLite3::class, new Db\StatementSQLite3($this->c, $this->s));
|
|
|
|
}
|
|
|
|
}
|