This PluginTestCase class sets the db parameters for the sqlite database for good.
/*
* Store database in memory
*/
$app['config']->set('database.default', 'sqlite');
$app['config']->set('database.connections.sqlite', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => ''
]);
I want to use mysql and I want to change those parameters in extending phpunit test class to not mess in the original class.
How to do it? I have to change those above into these.
$app['config']->set('database.default', 'mysql');
$app['config']->set('database.connections.mysql', [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'database' => 'myserver_tests',
'username' => 'test',
'password' => 'mypass',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
]);
Last updated