Skip to content

Commit

Permalink
Cleanup connection in env setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnorthrip committed Mar 14, 2024
1 parent fd29d65 commit 15db8e4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ protected function getPackageProviders($app)

public function getEnvironmentSetUp($app)
{
config()->set('database.connections.testing', [
'driver' => 'mysql',
'host' => '127.0.0.1',
'port' => '3306',
'database' => 'dbpull_test',
'username' => 'root',
'password' => '',
]);
$connection = [
'driver' => env('DB_CONNECTION','mysql'),
'host' => env('DB_HOST','127.0.0.1'),
'port' => env('DB_PORT','3306'),
'database' => env('DB_DATABASE','dbpull_test'),
'username' => env('DB_USERNAME','root'),
];
if (env('DB_PASSWORD')) {
$connection['password'] = env('DB_PASSWORD');
}

config()->set('database.connections.testing', $connection);
config()->set('database.default', 'testing');

/*
Expand Down

0 comments on commit 15db8e4

Please sign in to comment.