1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2025-01-10 18:02:40 +00:00
Arsse/tests/Db/SQLite3/TestDbStatementSQLite3.php
J. King 0c410fcf50 More binding tests and related changes
- Introduced abstract Statement class to hold common methods
- Common methods currently consist of a date formatter and type caster
- Moved binding tests to a trait for reuse with future drivers
2017-03-02 18:42:19 -05:00

32 lines
No EOL
777 B
PHP

<?php
declare(strict_types=1);
namespace JKingWeb\NewsSync;
class TestDbStatementSQLite3 extends \PHPUnit\Framework\TestCase {
use Test\Tools, Test\Db\BindingTests;
protected $c;
protected $s;
static protected $imp = Db\StatementSQLite3::class;
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));
}
}