conn ) ) { if ( ! isset( $this->pdo ) ) { $this->dbPath = $this->getDbPath(); $this->pdo = new \PDO( "sqlite:{$this->dbPath}" ); } $this->conn = $this->createDefaultDBConnection( $this->pdo, $this->dbPath ); } return $this->conn; } protected function getDbPath() { return dirname( __FILE__ ) . '/db.sqlite'; } protected function setUp() { parent::setUp(); $dbPath = $this->getDbPath(); if ( file_exists( $dbPath ) ) { unlink( $dbPath ); } $config = ActivityPubConfig::createBuilder() ->setDbConnectionParams( array( 'driver' => 'pdo_sqlite', 'path' => $dbPath, ) ) ->build(); $activityPub = new ActivityPub( $config ); $activityPub->updateSchema(); } protected function tearDown() { parent::tearDown(); if ( file_exists( $this->getDbPath() ) ) { unlink( $this->getDbPath() ); } unset( $this->conn ); unset( $this->pdo ); } }