Call require as statment. Closes #123

This commit is contained in:
SilverFire - Dmitry Naumenko 2017-08-07 23:46:37 +03:00
parent 02cf920ff9
commit 4dc90946e9
6 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
$params = require(__DIR__ . '/params.php'); $params = require __DIR__ . '/params.php';
$db = require(__DIR__ . '/db.php'); $db = require __DIR__ . '/db.php';
$config = [ $config = [
'id' => 'basic-console', 'id' => 'basic-console',

View File

@ -1,6 +1,6 @@
<?php <?php
$params = require(__DIR__ . '/params.php'); $params = require __DIR__ . '/params.php';
$db = require(__DIR__ . '/test_db.php'); $db = require __DIR__ . '/test_db.php';
/** /**
* Application configuration shared by all test types * Application configuration shared by all test types

View File

@ -1,5 +1,5 @@
<?php <?php
$db = require(__DIR__ . '/db.php'); $db = require __DIR__ . '/db.php';
// test database! Important not to run tests on production or development databases // test database! Important not to run tests on production or development databases
$db['dsn'] = 'mysql:host=localhost;dbname=yii2_basic_tests'; $db['dsn'] = 'mysql:host=localhost;dbname=yii2_basic_tests';

View File

@ -1,7 +1,7 @@
<?php <?php
$params = require(__DIR__ . '/params.php'); $params = require __DIR__ . '/params.php';
$db = require(__DIR__ . '/db.php'); $db = require __DIR__ . '/db.php';
$config = [ $config = [
'id' => 'basic', 'id' => 'basic',

View File

@ -11,14 +11,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');
require(__DIR__ . '/../../vendor/autoload.php'); require __DIR__ . '/../../vendor/autoload.php';
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
$config = yii\helpers\ArrayHelper::merge( $config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../config/console.php'), require __DIR__ . '/../../config/console.php',
[ [
'components' => [ 'components' => [
'db' => require(__DIR__ . '/../../config/test_db.php') 'db' => require __DIR__ . '/../../config/test_db.php'
] ]
] ]
); );

6
yii
View File

@ -11,10 +11,10 @@
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev'); defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/vendor/autoload.php'); require __DIR__ . '/vendor/autoload.php';
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php'); require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
$config = require(__DIR__ . '/config/console.php'); $config = require __DIR__ . '/config/console.php';
$application = new yii\console\Application($config); $application = new yii\console\Application($config);
$exitCode = $application->run(); $exitCode = $application->run();