I have problem in database config in codeception for my project in yii2. Everytime I executed the codecept run. There was an error [yii\db\Exception] SQLSTATE[HY000] [1049] Unknown database ‘yii2advanced_test’ which is the database config on common/config/main-local is ‘mydb’. I googled the solutions and applied it but nothing works.
Here is my main-local.php
<?php
return [
‘components’ => [
‘db’ => [
‘class’ => ‘yii\db\Connection’,
‘dsn’ => ‘mysql:host=localhost;dbname=mydb’,
‘username’ => ‘root’,
‘password’ => ‘’,
‘charset’ => ‘utf8’,
],
‘mailer’ => [
‘class’ => ‘yii\swiftmailer\Mailer’,
‘viewPath’ => ‘@common/mail’,
// send all mails to a file by default. You have to set
// ‘useFileTransport’ to false and configure a transport
// for the mailer to send real emails.
‘useFileTransport’ => true,
],
],
];
and I tried to add this code in functional.suite.yml
suite_namespace: frontend\tests\functional
actor: FunctionalTester
modules:
enabled:
- Filesystem
- Yii2
- Db
config:
Db:
dsn: 'mysql:host=localhost;dbname=mydb'
user: 'root'
password: ''
dump: tests/_data/dump.sql
Still nothing works. Please help me