From aeffb7184e95ce6e5a68187b5a8528fbcc95bac6 Mon Sep 17 00:00:00 2001 From: Stefan Linke Date: Sat, 23 Jul 2022 12:21:21 +0000 Subject: [PATCH] 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 --- .env.example | 1 + config/database.php | 1 + 2 files changed, 2 insertions(+) diff --git a/.env.example b/.env.example index 6549ddec8..025133187 100644 --- a/.env.example +++ b/.env.example @@ -41,6 +41,7 @@ DB_USERNAME=homestead DB_PASSWORD=secret DB_PREFIX= DB_TEST_HOST=127.0.0.1 +DB_TEST_PORT=3306 DB_TEST_DATABASE=monica_test DB_TEST_USERNAME=homestead DB_TEST_PASSWORD=secret diff --git a/config/database.php b/config/database.php index a9a3d7bf2..d13bd5910 100644 --- a/config/database.php +++ b/config/database.php @@ -99,6 +99,7 @@ $db = [ 'testing' => [ 'driver' => env('DB_TEST_DRIVER', 'mysql'), 'host' => env('DB_TEST_HOST'), + 'port' => env('DB_TEST_PORT', '3306'), 'unix_socket' => env('DB_TEST_UNIX_SOCKET', ''), 'database' => env('DB_TEST_DATABASE'), 'username' => env('DB_TEST_USERNAME'),