Finnally I figure it out: I update laravel framework from 11 to 12,but never update other packages, I run composer update, and everything works fine as expcted. Some old version of those packages must be the reason cause problems.
Mar 17, 2025
1
Level 23
Phpunit is adding prefix on db name while running migrations
laravel vresion: 12.0.1
php version: 8.4
pest version: 3.7.4
When I first run test in an empty database,it won't cause any problem. But if RefreshDatabase or LazilyRefreshDatabase is added in TestCase, the second time running test is gonna cause an error, because it somehow add prefix not only on the table, but also on database name while migrating database. My actual db name is campus_testing, phpunit is trying to migrate tables on db x_campus_campus_testing since my prefix config on app\database.php is set to x_campus_. Still trying to find a solution....
Level 23
Please or to participate in this conversation.