diff --git a/test/Config/SQLiteTestCase.php b/test/Config/SQLiteTestCase.php new file mode 100644 index 0000000..3542a09 --- /dev/null +++ b/test/Config/SQLiteTestCase.php @@ -0,0 +1,54 @@ + array( + 'driver' => 'pdo_sqlite', + 'path' => $dbPath, + ), + ) ); + $activityPub->updateSchema(); + } + + protected function tearDown() + { + parent::tearDown(); + unlink( dirname( __FILE__ ) . '/../db.sqlite' ); + unset( $this->conn ); + unset( $this->pdo ); + } + + final public function getConnection() + { + if ( $this->conn === null ) { + if ( $this->pdo === null ) { + $this->dbPath = dirname( __FILE__ ) . '/../db.sqlite'; + $this->pdo = new \PDO( "sqlite:{$this->dbPath}" ); + } + $this->conn = $this->createDefaultDBConnection( $this->pdo, $this->dbPath ); + } + return $this->conn; + } +} +?>