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
$params = require(__DIR__ . '/params.php');
$db = require(__DIR__ . '/db.php');
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$config = [
'id' => 'basic-console',

View File

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

View File

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

View File

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

View File

@ -11,14 +11,14 @@
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test');
require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../config/console.php'),
require __DIR__ . '/../../config/console.php',
[
'components' => [
'db' => require(__DIR__ . '/../../config/test_db.php')
'db' => require __DIR__ . '/../../config/test_db.php'
]
]
);
@ -26,4 +26,4 @@ $config = yii\helpers\ArrayHelper::merge(
$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
exit($exitCode);

6
yii
View File

@ -11,10 +11,10 @@
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require __DIR__ . '/vendor/autoload.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);
$exitCode = $application->run();