Level 70
@orest Have you tested this article?
https://dev.to/dbilovd/dynamic-config-values-for-each-phpunit-test-case-in-laravel-402g
5 likes
by default the database variables in the phpunit.xml are the following:
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
In one of my tests, i want to set the DB_CONNECTION to mysql because i test a functionality which uses whereJsonContains which is not supported by sqlite.
Is there a way to change the DB_CONNECTION at runtime ?
putenv and config but none of them workmysql because it is considerably slower than using memory database@orest Have you tested this article?
https://dev.to/dbilovd/dynamic-config-values-for-each-phpunit-test-case-in-laravel-402g
Please or to participate in this conversation.