mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-09 08:47:34 +01:00
Fixes #6103: Improved codeception config in app templates to ease testing of advanced app on multiple hosts
This commit is contained in:
committed by
Alexander Makarov
parent
af50f5a290
commit
6c88467ac4
@@ -2,7 +2,7 @@
|
||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
defined('YII_ENV') or define('YII_ENV', 'test');
|
||||
|
||||
defined('YII_TEST_ENTRY_URL') or define('YII_TEST_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']);
|
||||
defined('YII_TEST_ENTRY_URL') or define('YII_TEST_ENTRY_URL', parse_url(\Codeception\Configuration::config()['config']['test_entry_url'], PHP_URL_PATH));
|
||||
defined('YII_TEST_ENTRY_FILE') or define('YII_TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/web/index-test.php');
|
||||
|
||||
require_once(__DIR__ . '/../../vendor/autoload.php');
|
||||
@@ -10,6 +10,7 @@ require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
|
||||
|
||||
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
|
||||
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
|
||||
$_SERVER['SERVER_NAME'] = 'localhost';
|
||||
$_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';
|
||||
|
||||
Yii::setAlias('@tests', dirname(__DIR__));
|
||||
|
||||
Reference in New Issue
Block a user