Fix test DB setup

This commit is contained in:
Jeremy Dormitzer 2018-11-20 05:52:18 -05:00
parent 6c58cf1d90
commit 484d35d3ce

View File

@ -10,15 +10,15 @@ abstract class APTestCase extends TestCase
private static $pdo = null; private static $pdo = null;
private $conn = null; private $conn = null;
private $dbPath = ''; protected $dbPath = '';
final public function getConnection() { final public function getConnection() {
if ( $this->conn === null ) { if ( $this->conn === null ) {
if ( self::$pdo === null ) { if ( self::$pdo === null ) {
$this->dbPath = dirname( __FILE__ ) . '../db.sqlite'; $this->dbPath = dirname( __FILE__ ) . '/../db.sqlite';
self::$pdo = new \PDO( "sqlite:{$this->dbPath}" ); self::$pdo = new \PDO( "sqlite:{$this->dbPath}" );
} }
$this->conn = $this->createDefaultConnection( self::$pdo, $this->dbPath ); $this->conn = $this->createDefaultDBConnection( self::$pdo, $this->dbPath );
} }
return $this->conn; return $this->conn;
} }