Skip to content

Commit

Permalink
Updated RFEnvironment for Codeception
Browse files Browse the repository at this point in the history
  • Loading branch information
naffiq committed May 10, 2017
1 parent 14a3b07 commit b77aa69
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions rocket/RFEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,37 @@ protected static function merge($a, $b)

return $res;
}

/**
* Defines Yii constants, includes base Yii class, sets aliases and merges class map.
*/
public function setup()
{
/**
* This constant defines whether the application should be in debug mode or not.
*/
defined('YII_DEBUG') or define('YII_DEBUG', $this->yiiDebug);
/**
* This constant defines in which environment the application is running.
* The value could be 'prod' (production), 'stage' (staging), 'test' (testing) or 'dev' (development).
*/
defined('YII_ENV') or define('YII_ENV', $this->yiiEnv);
/**
* Whether the the application is running in staging environment.
*/
defined('YII_ENV_STAGE') or define('YII_ENV_STAGE', YII_ENV === 'stage');

// Include Yii.
require_once($this->yiiPath);

// Set aliases.
foreach ($this->aliases as $alias => $path) {
\Yii::setAlias($alias, $path);
}

// Merge class map.
if (!empty($this->classMap)) {
\Yii::$classMap = static::merge(\Yii::$classMap, $this->classMap);
}
}
}

0 comments on commit b77aa69

Please sign in to comment.