I have found vague hints on the internet that we can speed up Unittests with an in-memory database by using the following line in our phpunit.xml file:

<env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>

However, this will not work for me. In the method BrowserTestBase::testLoad, I will run into the error Undefined index: value without any further explanation. With a MySQL database, everything works fine (albeit slowly).

What is the correct way to use an in-memory sqlite database for Unittests? Must I install something? Must I put something into the settings file? Is this feature documented somewhere?

  • Do you have an error log you could share with us? – Wilson Hauck Aug 28 '20 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.