Skip to content

Commit

Permalink
Fix up test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 13, 2023
1 parent 03da508 commit 7b1ca85
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,12 @@ class_alias(TestApp\View\AppView::class, 'App\View\AppView');

Cache::setConfig($cache);

// Allow local overwrite
// E.g. in your console: export DB_URL="mysql://root:secret@127.0.0.1/cake_test"
if (getenv('DB_URL')) {
ConnectionManager::setConfig('test', [
'url' => getenv('DB_URL'),
'quoteIdentifiers' => false,
'cacheMetadata' => true,
]);

return;
}

if (!getenv('DB_URL')) {
putenv('DB_CLASS=Cake\Database\Driver\Sqlite');
putenv('DB_URL=sqlite:///:memory:');
}

// Uses Travis config then (MySQL, Postgres, ...)
ConnectionManager::setConfig('test', [
'className' => 'Cake\Database\Connection',
'driver' => getenv('DB_CLASS') ?: null,
'dsn' => getenv('DB_URL') ?: null,
'url' => getenv('DB_URL') ?: null,
'timezone' => 'UTC',
'quoteIdentifiers' => false,
'cacheMetadata' => true,
Expand Down

0 comments on commit 7b1ca85

Please sign in to comment.