Yii2 Codeception Migration issue

Hello fellow Yii2 devs,

I am having diffulcties with setting up Codeception under the Yii2 Advanced App.

The README.md in [approot]/tests tells me to do this (step 3):

When I run that commmand, I get this issue:

I have been trying different things for quite some time now, but at a loss on how to fix this.

Anyone know what’s causing this?

I noticed the file [approot]/tests/codeception/config/config.php contains the ‘db’ component, like this:

That’s the literal file from GitHub, am I forgetting to include a class of some sort?

Thanks for your help,

Alex

yourapp/common/config/config-local.php - or console/config/config-local.php - whatever - need to have the complete config.

Not just the dsn-override.

Fix the db for the rest of your application:


<?php

return [

	'components' => [

    	'db' => [

        	'class' => 'yii\db\Connection',

        	'dsn' => 'mysql:host=HOST;dbname=DBNAME',

        	'username' => 'USER',

        	'password' => 'PASSWORD',

        	'charset' => 'utf8',

    	],//db



The config for the tests override the dsn so that you are using the test database, and not the ‘real’ database.

Thanks that helped.

But I’m now getting this error, after having done:

I thought this had to do with the Global version of codeception having a different version than the one in vendor/bin, but that’s not the case (am using version 2.0.5 of codeception).

Have I got a wrong configuration someplace else?

Thanks again for your help!

Created a new forum topic for my last question, here:

http://www.yiiframework.com/forum/index.php/topic/68637-yii2-codeception-in-advanced-template/