2013-12-02 15:25:21 +04:00
|
|
|
<?php
|
2013-12-17 00:27:33 +01:00
|
|
|
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
|
|
|
defined('YII_ENV') or define('YII_ENV', 'test');
|
|
|
|
|
2014-11-19 14:37:13 +03:00
|
|
|
defined('YII_TEST_ENTRY_URL') or define('YII_TEST_ENTRY_URL', parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_PATH));
|
2014-08-18 01:56:36 +04:00
|
|
|
defined('YII_TEST_ENTRY_FILE') or define('YII_TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/web/index-test.php');
|
2013-12-28 15:04:08 -05:00
|
|
|
|
2014-08-16 18:38:56 +04:00
|
|
|
require_once(__DIR__ . '/../../vendor/autoload.php');
|
2014-08-15 03:30:47 +04:00
|
|
|
require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
|
2013-12-17 00:27:33 +01:00
|
|
|
|
2014-08-18 01:56:36 +04:00
|
|
|
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
|
|
|
|
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
|
2014-11-19 14:37:13 +03:00
|
|
|
$_SERVER['SERVER_NAME'] = parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_HOST);
|
|
|
|
$_SERVER['SERVER_PORT'] = parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_PORT) ?: '80';
|
2013-12-28 15:04:08 -05:00
|
|
|
|
2014-08-24 14:14:35 +04:00
|
|
|
Yii::setAlias('@tests', dirname(__DIR__));
|
2016-07-11 13:43:55 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* this configure codeception specify to not deep clone objects properties
|
|
|
|
* it can be configure localy in your tests
|
|
|
|
* @see https://github.com/Codeception/Specify/tree/master/docs
|
|
|
|
*/
|
|
|
|
\Codeception\Specify\Config::setDeepClone(false);
|