<?php

/**
  * Yii1Basic module class file.
  */
namespace Helper;

use Yii;

/**
  * 
  * @package Codeception.Module
  * @version $Id$
  */
class Yii1Basic extends \Codeception\Module
{

  public function _initialize()
  {
      mb_internal_encoding('iso-8859-1');
      defined('YII_BASE') or define('YII_BASE', realpath(dirname(__FILE__).'/../../../../../'));
      defined('VERSAO') or define('VERSAO', '3.1');
      defined('DS') or define('DS', DIRECTORY_SEPARATOR);
      defined('YII_DEBUG') or define('YII_DEBUG',true);
      defined('BASE_TESTES') or define('BASE_TESTES', true);
      defined('DATA_BASE') or define('DATA_BASE', '06/03/2017 09:00');
      defined('YII_DEBUG') or define('YII_DEBUG',true);
      defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

      $autoload = YII_BASE . '/protected/extensions/vendor/autoload.php';
      $yii = YII_BASE . '/framework/yii.php';
      $config = YII_BASE . '/protected/config/main.php';

      require_once('PHPUnit/Autoload.php');
      require_once('PHPUnit/Extensions/vendor/autoload.php');
      require_once($autoload);
      require_once($yii);

      if(!is_a(Yii::app(), 'CWebApplication')) {
        $aplication = Yii::createWebApplication($config);
      }
  }
}