-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auth to the MongoDB database(s), and use the new SQLite adapters …
…instead of Doctrine DBAL
- Loading branch information
1 parent
ac433a6
commit 0dc92e3
Showing
11 changed files
with
186 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php declare(strict_types=1); | ||
namespace Imbo\Behat\DatabaseTest; | ||
|
||
use Imbo\Behat\AdapterTest; | ||
use Imbo\Database\PDOAdapter; | ||
use Imbo\Database\SQLite as DatabaseAdapter; | ||
use PDO; | ||
|
||
/** | ||
* Class for suites that want to use the SQLite database adapter | ||
*/ | ||
class SQLite implements AdapterTest { | ||
static public function setUp(array $config) { | ||
$pdo = new PDO($config['database.dsn']); | ||
|
||
foreach ([PDOAdapter::SHORTURL_TABLE, PDOAdapter::IMAGEINFO_TABLE] as $table) { | ||
$pdo->query("DELETE FROM `{$table}`"); | ||
} | ||
|
||
return $config; | ||
} | ||
|
||
static public function tearDown(array $config) {} | ||
|
||
static public function getAdapter(array $config) : DatabaseAdapter { | ||
return new DatabaseAdapter($config['database.dsn']); | ||
} | ||
} |
Oops, something went wrong.