title: Namespaces not working with Codeception (Yii2)
body: <p>Im using Codeception in Yii2 to make acceptance tests and there's no way to access my models because namespaces are not working into these tests.</p>
  
  <p>I have this in my tests/_bootstrap.php</p>
  
  <pre><code> require(__DIR__ . '/../vendor/autoload.php');
   require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
  
   $config = require(__DIR__ . '/../console/config/main.php');
   //
   $application = new yii\console\Application( $config );
  
   ## Added (@vitalik_74)
   Yii::setAlias('@tests', dirname(__DIR__));
  </code></pre>
  
  <p>This in my console/config/main</p>
  
  <pre><code> &lt;?php
   $params = array_merge(
       require(__DIR__ . '/params.php'),
       require(__DIR__ . '/params-local.php')
   );
  
   return [
       'id' =&gt; 'app-console',
       'basePath' =&gt; dirname(__DIR__),
       'bootstrap' =&gt; ['log'],
       'controllerNamespace' =&gt; 'console\controllers',
       'components' =&gt; [
           'log' =&gt; [
               'targets' =&gt; [
                   [
                       'class' =&gt; 'yii\log\FileTarget',
                       'levels' =&gt; ['error', 'warning'],
                   ],
               ],
           ],
       ],
       'params' =&gt; $params,
   ];
  
   &lt;?php
   return [
       'adminEmail' =&gt; 'admin@example.com',
       'supportEmail' =&gt; 'support@example.com',
       'user.passwordResetTokenExpire' =&gt; 3600,
   ];
  </code></pre>
  
  <p>And this is one of the wannabe-tests:</p>
  
  <pre><code> &lt;?php namespace tests\acceptance;
  
   use \AcceptanceTester;
   use backend\models\User; ## I have tried writing it with a / at the beggining
  
  class ListUserCest
  {
  public function _before(AcceptanceTester $I)
  {
  
  }
  
  public function _after(AcceptanceTester $I)
  {
  }
  
  public function init(AcceptanceTester $I)
  {
      $this-&gt;login($I);
  
      if( User::find()-&gt;exists() )
          $I-&gt;amGoingTo('List Users having at least one');
      else
          $I-&gt;amGoingTo('List Users having any');
  }
  
  ...
  </code></pre>
  
  <p>I get this error when running the tests:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Class 'backend\models\User' not found in /var/www/project/tests/acceptance/ListUserCest.php on line 21
    Error: Class 'backend\models\User' not found</p>
  </blockquote>
  
  <p>Please, help me, I have tried everything I know</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Now (after adding the line recommended by vitalik_74) I can use for example, \Yii methods into the tests but witout the web application configuration, just the console configuration.
  I mean, I still can't use \backend\models\User and I can't neither access the Yii::$app->user status (to check if user is logged, for example).</p>
  
  <p>The User model is just a common ActiveRecord model with his tableName, rules, attributeLabels, and some relational methods like getProfile().
  It works out of the tests</p>
  
  <pre><code>&lt;?php
  namespace backend\models;
  use common\helpers\MathHelper;
  use backend\models\AntropometricData;
  use Yii;
  
  class User extends \yii\db\ActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return 'user';
      }
  ...
  </code></pre>