Codeception API testing+Yii2. How to specify a different database for the test?

Please tell me how to run API tests with the test database?

$I = new ApiTester($scenario);
$I->wantTo('Get something');


All the rules, but just do not want the base to touch.
July 8th 19 at 11:50
1 answer
July 8th 19 at 11:52
I'm certainly a novice and do not understand much... but it's not easier to temporarily rewrite the file db.php in api/config/requires?
What type of pushed back and all returned. I like this in the file
// 'dsn' => 'mysql:host="blah blah";dbname=tor',
// 'username' => 'tor',
// 'password' => ",
// 'charset' => 'utf8',

 'dsn' => 'mysql:host=;dbname=tor',
 'username' => 'root',
 'password' => ",
 'charset' => 'utf8',

when you have disconnected when you have connected
Thanks, I'll try. And do not tell me how to admit the receipt of the user id is found in the code Yii::$app->user->getId(), and sledovatelno, the return value is zero - enola_Waters commented on July 8th 19 at 11:55
well, as an option, you can see global variable $_SESSION. Suddenly there there - keenan40 commented on July 8th 19 at 11:58

Find more questions by tags CodeceptionYii