Commit c33214b3 by Alexander Makarov

Adjusted test configs structure

parent 28091ed2
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(dirname(__DIR__)) . '/config/backend/acceptance.php'));
......@@ -14,4 +14,4 @@ modules:
- codeception\common\_support\FixtureHelper
config:
Yii2:
configFile: 'functional/_config.php'
configFile: '../config/backend/functional.php'
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(dirname(__DIR__)) . '/config/backend/functional.php'));
......@@ -4,5 +4,5 @@ namespace backend\tests\unit;
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@backend/tests/unit/_config.php';
public $appConfig = '@codeception/config/backend/unit.php';
}
......@@ -4,5 +4,5 @@ namespace backend\tests\unit;
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@backend/tests/unit/_config.php';
public $appConfig = '@codeception/config/backend/unit.php';
}
......@@ -8,19 +8,15 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/acceptance.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
......
......@@ -8,19 +8,15 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/functional.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
......
......@@ -8,19 +8,15 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config/unit.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
......
......@@ -7,5 +7,5 @@ namespace codeception\common\unit;
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/common/unit/_config.php';
public $appConfig = '@codeception/config/common/unit.php';
}
......@@ -7,5 +7,5 @@ namespace common\tests\unit;
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@common/tests/unit/_config.php';
public $appConfig = '@codeception/config/common/unit.php';
}
<?php
/**
* application configurations shared by all test types
* Application configuration shared by all applications acceptance tests
*/
return [
'components' => [
'mailer' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
];
\ No newline at end of file
<?php
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__)))));
return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'),
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/acceptance.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
);
<?php
return [];
\ No newline at end of file
......@@ -7,12 +7,9 @@ return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/backend/config/main-local.php'),
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/functional.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
);
......@@ -5,12 +5,9 @@ return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/backend/config/main.php'),
require(ROOT_DIR . '/backend/config/main-local.php'),
require(dirname(__DIR__) . '/_config.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
]
);
<?php
/**
* Application config for common unit tests
*/
return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
'id' => 'app-common',
'basePath' => dirname(__DIR__),
]
......
<?php
/**
* application configurations shared by all test types
* Application configuration shared by all applications and test types
*/
return [
'components' => [
......
<?php
return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/console/config/main.php'),
require(ROOT_DIR . '/console/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'),
[
]
);
<?php
defined('ROOT_DIR') or define('ROOT_DIR', dirname(dirname(dirname(dirname(__DIR__)))));
return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'),
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/acceptance.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
]
);
<?php
return [];
\ No newline at end of file
......@@ -3,16 +3,13 @@ $_SERVER['SCRIPT_FILENAME'] = FRONTEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = FRONTEND_ENTRY_URL;
return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'),
require(ROOT_DIR . '/common/config/main.php'),
require(ROOT_DIR . '/common/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/functional.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_functional',
],
],
]
);
......@@ -5,12 +5,9 @@ return yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/common/config/main-local.php'),
require(ROOT_DIR . '/frontend/config/main.php'),
require(ROOT_DIR . '/frontend/config/main-local.php'),
require(__DIR__ . '/../_config.php'),
require(dirname(__DIR__) . '/config.php'),
require(dirname(__DIR__) . '/unit.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
]
);
<?php
/**
* application configurations shared by all test types
* Application configuration shared by all applications functional tests
*/
return [
'components' => [
'mailer' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_acceptance',
],
],
];
\ No newline at end of file
<?php
/**
* application configurations shared by all test types
* Application configuration shared by all applications unit tests
*/
return [
'components' => [
'mailer' => [
'useFileTransport' => true,
],
'urlManager' => [
'showScriptName' => true,
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
];
\ No newline at end of file
......@@ -7,5 +7,5 @@ namespace console\tests\unit;
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@console/tests/unit/_config.php';
public $appConfig = '@codeception/config/console/config.php';
}
......@@ -7,5 +7,5 @@ namespace console\tests\unit;
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@console/tests/unit/_config.php';
public $appConfig = '@codeception/config/console/config.php';
}
<?php
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../common/config/main.php'),
require(__DIR__ . '/../../../common/config/main-local.php'),
require(__DIR__ . '/../../config/main.php'),
require(__DIR__ . '/../../config/main-local.php'),
require(__DIR__ . '/../_config.php'),
[
'components' => [
'db' => [
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_unit',
],
],
]
);
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(dirname(__DIR__)) . '/config/frontend/acceptance.php'));
......@@ -14,4 +14,4 @@ modules:
- codeception\common\_support\FixtureHelper
config:
Yii2:
configFile: 'functional/_config.php'
configFile: '../config/frontend/functional.php'
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(dirname(__DIR__)) . '/config/frontend/functional.php'));
......@@ -7,5 +7,5 @@ namespace codeception\frontend\unit;
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/frontend/unit/_config.php';
public $appConfig = '@codeception/config/frontend/unit.php';
}
......@@ -7,5 +7,5 @@ namespace codeception\frontend\unit;
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@codeception/frontend/unit/_config.php';
public $appConfig = '@codeception/config/frontend/unit.php';
}
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(__DIR__) . '/config/acceptance.php'));
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test');
// fcgi doesn't have STDIN and STDOUT defined by default
......
......@@ -8,11 +8,11 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/../config/config.php'),
[
'components' => [
'db' => [
......
......@@ -8,11 +8,11 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/../config/config.php'),
[
'components' => [
'db' => [
......
......@@ -8,11 +8,11 @@
* @license http://www.yiiframework.com/license/
*/
require_once __DIR__ . '/_console_bootstrap.php';
require_once __DIR__ . '/_bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require(ROOT_DIR . '/config/console.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/../config/config.php'),
[
'components' => [
'db' => [
......
<?php
/**
* Application configuration for acceptance tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../config/web.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
......
<?php
/**
* application configurations shared by all test types
* Application configuration shared by all test types
*/
return [
'components' => [
......
......@@ -2,9 +2,12 @@
$_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = TEST_ENTRY_URL;
/**
* Application configuration for functional tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../config/web.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
......
<?php
/**
* Application configuration for unit tests
*/
return yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../../config/web.php'),
require(__DIR__ . '/../_config.php'),
require(__DIR__ . '/config.php'),
[
'components' => [
'db' => [
......
......@@ -13,4 +13,4 @@ modules:
- Yii2
config:
Yii2:
configFile: 'codeception/functional/_config.php'
configFile: 'codeception/config/functional.php'
<?php
new yii\web\Application(require(__DIR__ . '/_config.php'));
new yii\web\Application(require(dirname(__DIR__) . '/config/functional.php'));
......@@ -11,6 +11,6 @@ defined('YII_ENV') or define('YII_ENV', 'test');
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/../tests/codeception/acceptance/_config.php');
$config = require(__DIR__ . '/../tests/codeception/config/acceptance.php');
(new yii\web\Application($config))->run();
......@@ -31,7 +31,7 @@ class TestCase extends Test
* The application configuration array may contain an optional `class` element which specifies the class
* name of the application instance to be created. By default, a [[\yii\web\Application]] instance will be created.
*/
public $appConfig = '@codeception/unit/_config.php';
public $appConfig = '@codeception/config/unit.php';
/**
......
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