I have a laravel project with a Dusk setup.
From the docs, to keep the database clean for tests, we should use DatabaseTruncation trait.
In my case, the trait works, but when I set a parameter $exceptTables = ['table1', 'table2'], they still get truncated whereas they shouldn't.
When using the parameter $tablesToTruncate = ['table1'], it works correctly.
I could put all the tables in this second parameter, but it would be cleaner to just specify the few ones I mustn't truncate.
Anyone has seen this before?
Reading the
DatabaseTruncationtrait here,$exceptTablesshould be grouped by connection name as shown, and$connectionsToTruncateshould be present.I submitted a pull request to Laravel 10 to support an array of table names without the connection key: https://github.com/laravel/framework/pull/47477