fix(tests): isolate databases in memory and reject persistent connections
This commit is contained in:
16
tests/bootstrap.php
Normal file
16
tests/bootstrap.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Set every environment source before Laravel or Dotenv can read the local .env.
|
||||
foreach ([
|
||||
'APP_ENV' => 'testing',
|
||||
'DB_CONNECTION' => 'sqlite',
|
||||
'DB_DATABASE' => ':memory:',
|
||||
'DB_URL' => 'null',
|
||||
'APP_CONFIG_CACHE' => __DIR__.'/../bootstrap/cache/phpunit-config.php',
|
||||
] as $key => $value) {
|
||||
putenv($key.'='.$value);
|
||||
$_ENV[$key] = $value;
|
||||
$_SERVER[$key] = $value;
|
||||
}
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
Reference in New Issue
Block a user