Created
July 17, 2014 10:36
-
-
Save motin/aa7ac5ce0f07da2da4c7 to your computer and use it in GitHub Desktop.
Yii unit test _bootstrap for codeception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_SERVER['SCRIPT_FILENAME'] = 'index-test.php'; | |
$_SERVER['SCRIPT_NAME'] = '/index-test.php'; | |
$_SERVER['REQUEST_URI'] = 'index-test.php'; | |
// change the following paths if necessary | |
$yiit=dirname(__FILE__).'/../../../vendor/yiisoft/yii/framework/yiit.php'; | |
require_once($yiit); | |
$main=require(dirname(__FILE__).'/../../../app/config/main.php'); | |
$env=require(dirname(__FILE__)."/../../../app/config/environments/" . CONFIG_ENVIRONMENT . ".php"); | |
// require composer autoloader | |
require_once(dirname(__FILE__).'/../../../vendor/autoload.php'); | |
$config = CMap::mergeArray($main, $env); | |
$config['components']['db'] = $config['components']['dbTest']; | |
if (!Yii::app()) Yii::createWebApplication($config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment