Skip to content

Commit aeffb71

Browse files
authored
fix: allow configuring port for test database (#6236)
The `testing` database used for the tests had no way to configure a db server port. It always used some default fallback port (probably of the pdo driver). Added the `port` config setting with a new env variable `DB_TEST_PORT`. Fixes #6200
1 parent 7c8105c commit aeffb71

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ DB_USERNAME=homestead
4141
DB_PASSWORD=secret
4242
DB_PREFIX=
4343
DB_TEST_HOST=127.0.0.1
44+
DB_TEST_PORT=3306
4445
DB_TEST_DATABASE=monica_test
4546
DB_TEST_USERNAME=homestead
4647
DB_TEST_PASSWORD=secret

config/database.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
'testing' => [
100100
'driver' => env('DB_TEST_DRIVER', 'mysql'),
101101
'host' => env('DB_TEST_HOST'),
102+
'port' => env('DB_TEST_PORT', '3306'),
102103
'unix_socket' => env('DB_TEST_UNIX_SOCKET', ''),
103104
'database' => env('DB_TEST_DATABASE'),
104105
'username' => env('DB_TEST_USERNAME'),

0 commit comments

Comments
 (0)