Do you have this in your base test file?
use DatabaseMigrations;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've been trying to get the tests working on sqlite in memory database but I have been hitting the error 'SQLSTATE[HY000]: General error: 1 no such table'
I have cleared the config cache over and over again and the connection is defined in phpunit.xml
I am using Laravel 6.0.4 and globally installed phpunit is at version 8.3.5 PHP Version is 7.2.13 and SQLite version is 3.24.0
Any ideas?
Found it: the problem came from one of my helper classes that accessed database and which was shared to views with View::share() and this was done in AppServiceProviders boot -method and it really was not cool place for it :)
Moved it to middleware where it can be shared only when it is really needed.
After this change the tests work again and with the sqlite :memory:
Please or to participate in this conversation.