Commit 480b03be by Alexander Makarov

Prefixed constants to avoid possible naming conflicts

parent 2df4dff4
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
defined('BACKEND_ENTRY_URL') or define('BACKEND_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']); defined('YII_BACKEND_TEST_ENTRY_URL') or define('YII_BACKEND_TEST_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']);
defined('BACKEND_ENTRY_FILE') or define('BACKEND_ENTRY_FILE', ROOT_DIR . '/backend/web/index-test.php'); defined('YII_TEST_BACKEND_ENTRY_FILE') or define('YII_TEST_BACKEND_ENTRY_FILE', YII_ROOT_DIR . '/backend/web/index-test.php');
require_once(ROOT_DIR . '/vendor/autoload.php'); require_once(YII_ROOT_DIR . '/vendor/autoload.php');
require_once(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require_once(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
require(ROOT_DIR . '/common/config/aliases.php'); require(YII_ROOT_DIR . '/common/config/aliases.php');
// set correct script paths // set correct script paths
// the entry script file path for functional and acceptance tests // the entry script file path for functional and acceptance tests
$_SERVER['SCRIPT_FILENAME'] = BACKEND_ENTRY_FILE; $_SERVER['SCRIPT_FILENAME'] = YII_TEST_BACKEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = BACKEND_ENTRY_URL; $_SERVER['SCRIPT_NAME'] = YII_BACKEND_TEST_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', dirname(__DIR__)); Yii::setAlias('@codeception', dirname(__DIR__));
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w')); defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
require_once(ROOT_DIR . '/vendor/autoload.php'); require_once(YII_ROOT_DIR . '/vendor/autoload.php');
require_once(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require_once(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
require_once(ROOT_DIR . '/common/config/aliases.php'); require_once(YII_ROOT_DIR . '/common/config/aliases.php');
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'), require(YII_ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'), require(YII_ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/acceptance.php'), require(dirname(__DIR__) . '/config/acceptance.php'),
[ [
'controllerMap' => [ 'controllerMap' => [
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'), require(YII_ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'), require(YII_ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/functional.php'), require(dirname(__DIR__) . '/config/functional.php'),
[ [
'controllerMap' => [ 'controllerMap' => [
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'), require(YII_ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'), require(YII_ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/unit.php'), require(dirname(__DIR__) . '/config/unit.php'),
[ [
'controllerMap' => [ 'controllerMap' => [
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
require_once(ROOT_DIR . '/vendor/autoload.php'); require_once(YII_ROOT_DIR . '/vendor/autoload.php');
require_once(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require_once(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
require(ROOT_DIR . '/common/config/aliases.php'); require(YII_ROOT_DIR . '/common/config/aliases.php');
// set correct script paths // set correct script paths
$_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['SERVER_NAME'] = 'localhost';
......
<?php <?php
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__))))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__)))));
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/backend/config/main.php'), require(YII_ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'), require(YII_ROOT_DIR . '/backend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/acceptance.php'), require(dirname(__DIR__) . '/acceptance.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
<?php <?php
$_SERVER['SCRIPT_FILENAME'] = BACKEND_ENTRY_FILE; $_SERVER['SCRIPT_FILENAME'] = YII_TEST_BACKEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = BACKEND_ENTRY_URL; $_SERVER['SCRIPT_NAME'] = YII_BACKEND_TEST_ENTRY_URL;
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/backend/config/main.php'), require(YII_ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'), require(YII_ROOT_DIR . '/backend/config/main-local.php'),
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/functional.php'), require(dirname(__DIR__) . '/functional.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
<?php <?php
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/backend/config/main.php'), require(YII_ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'), require(YII_ROOT_DIR . '/backend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'), require(dirname(__DIR__) . '/unit.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Application config for common unit tests * Application config for common unit tests
*/ */
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'), require(dirname(__DIR__) . '/unit.php'),
[ [
......
<?php <?php
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'), require(YII_ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'), require(YII_ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'), require(dirname(__DIR__) . '/unit.php'),
[ [
......
<?php <?php
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__))))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__)))));
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/frontend/config/main.php'), require(YII_ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'), require(YII_ROOT_DIR . '/frontend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/acceptance.php'), require(dirname(__DIR__) . '/acceptance.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
...@@ -3,10 +3,10 @@ $_SERVER['SCRIPT_FILENAME'] = FRONTEND_ENTRY_FILE; ...@@ -3,10 +3,10 @@ $_SERVER['SCRIPT_FILENAME'] = FRONTEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = FRONTEND_ENTRY_URL; $_SERVER['SCRIPT_NAME'] = FRONTEND_ENTRY_URL;
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/frontend/config/main.php'), require(YII_ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'), require(YII_ROOT_DIR . '/frontend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/functional.php'), require(dirname(__DIR__) . '/functional.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
<?php <?php
return yii\helpers\ArrayHelper::merge( return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'), require(YII_ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'), require(YII_ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/frontend/config/main.php'), require(YII_ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'), require(YII_ROOT_DIR . '/frontend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'), require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'), require(dirname(__DIR__) . '/unit.php'),
require(__DIR__ . '/config.php'), require(__DIR__ . '/config.php'),
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
require_once(ROOT_DIR . '/vendor/autoload.php'); require_once(YII_ROOT_DIR . '/vendor/autoload.php');
require_once(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require_once(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
require(ROOT_DIR . '/common/config/aliases.php'); require(YII_ROOT_DIR . '/common/config/aliases.php');
// set correct script paths // set correct script paths
$_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['SERVER_NAME'] = 'localhost';
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
defined('FRONTEND_ENTRY_URL') or define('FRONTEND_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']); defined('FRONTEND_ENTRY_URL') or define('FRONTEND_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']);
defined('FRONTEND_ENTRY_FILE') or define('FRONTEND_ENTRY_FILE', ROOT_DIR . '/frontend/web/index-test.php'); defined('FRONTEND_ENTRY_FILE') or define('FRONTEND_ENTRY_FILE', YII_ROOT_DIR . '/frontend/web/index-test.php');
require_once(ROOT_DIR . '/vendor/autoload.php'); require_once(YII_ROOT_DIR . '/vendor/autoload.php');
require_once(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require_once(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
require(ROOT_DIR . '/common/config/aliases.php'); require(YII_ROOT_DIR . '/common/config/aliases.php');
// set correct script paths // set correct script paths
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); defined('YII_ENV') or define('YII_ENV', 'test');
defined('TEST_ENTRY_URL') or define('TEST_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']); defined('YII_TEST_ENTRY_URL') or define('YII_TEST_ENTRY_URL', \Codeception\Configuration::config()['config']['test_entry_url']);
defined('TEST_ENTRY_FILE') or define('TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/web/index-test.php'); defined('YII_TEST_ENTRY_FILE') or define('YII_TEST_ENTRY_FILE', dirname(dirname(__DIR__)) . '/web/index-test.php');
require_once(__DIR__ . '/../../vendor/autoload.php'); require_once(__DIR__ . '/../../vendor/autoload.php');
require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); require_once(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE; $_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = TEST_ENTRY_URL; $_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', __DIR__); Yii::setAlias('@codeception', __DIR__);
...@@ -6,7 +6,7 @@ defined('YII_ENV') or define('YII_ENV', 'test'); ...@@ -6,7 +6,7 @@ defined('YII_ENV') or define('YII_ENV', 'test');
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w')); defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(__DIR__)))); defined('YII_ROOT_DIR') or define('YII_ROOT_DIR', dirname(dirname(dirname(__DIR__))));
require(ROOT_DIR . '/vendor/autoload.php'); require(YII_ROOT_DIR . '/vendor/autoload.php');
require(ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php'); require(YII_ROOT_DIR . '/vendor/yiisoft/yii2/Yii.php');
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'), require(YII_ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../config/config.php'), require(__DIR__ . '/../config/config.php'),
[ [
'components' => [ 'components' => [
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'), require(YII_ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../config/config.php'), require(__DIR__ . '/../config/config.php'),
[ [
'components' => [ 'components' => [
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require_once __DIR__ . '/_bootstrap.php'; require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'), require(YII_ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../config/config.php'), require(__DIR__ . '/../config/config.php'),
[ [
'components' => [ 'components' => [
......
<?php <?php
$_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE; $_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = TEST_ENTRY_URL; $_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
/** /**
* Application configuration for functional tests * Application configuration for functional tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment