Error when running tests: [ReflectionException] Class db does not exist

When I try to start acceptance, functional and unit tests I get this error:


C:\projects\ais\tests\codeception\frontend>codecept run

Codeception PHP Testing Framework v2.0.0

Powered by PHPUnit 4.8.26 by Sebastian Bergmann and contributors.


  [ReflectionException]

  Class db does not exist

What it could be and how to fix?

All of my relevant configuration contain an associative array like this:


'db' => [

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

    'dsn' => 'sqlsrv:Server=...;Database=...;MultipleActiveResultSets=false',

    'username' => 'sa',

    'password' => '...',

    'charset' => 'utf8',

    'tablePrefix'=>'tbl_',

],