From 3fb01768780adc14dcc84132ab7515aa9e8a0944 Mon Sep 17 00:00:00 2001 From: Samuel Stancl Date: Mon, 8 Jun 2026 14:54:50 -0700 Subject: [PATCH] improve mysql charset/collation validation test --- tests/TenantDatabaseManagerTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/TenantDatabaseManagerTest.php b/tests/TenantDatabaseManagerTest.php index 692528fe..8346442c 100644 --- a/tests/TenantDatabaseManagerTest.php +++ b/tests/TenantDatabaseManagerTest.php @@ -628,11 +628,12 @@ test('database managers validate parameters that cannot be bound', function ($dr } })->with('database_managers'); -test('mysql database manager validates charset and collation correctly', function () { +test('mysql database manager validates charset and collation correctly', function (string $param) { $manager = app(MySQLDatabaseManager::class); $manager->setConnection('mysql'); - config(['database.connections.mysql.charset' => []]); + // using a non-string value (empty array) which is invalid + config(["database.connections.mysql.$param" => []]); DB::purge('mysql'); $tenant = Tenant::make([ @@ -641,7 +642,7 @@ test('mysql database manager validates charset and collation correctly', functio expect(fn () => $manager->createDatabase($tenant)) ->toThrow(InvalidArgumentException::class, 'Parameter has to be a string.'); -}); +})->with(['charset', 'collation']); test('sqlite database manager validates database names correctly', function () { $manager = app(SQLiteDatabaseManager::class);