Merge pull request #2383 from Ragazzo/add_yii_command_to_tests
added yii console command to tests
This commit is contained in:
commit
24151471d5
12
tests/_console_bootstrap.php
Normal file
12
tests/_console_bootstrap.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?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
|
||||
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
|
||||
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
|
||||
|
||||
require(__DIR__ . '/../vendor/autoload.php');
|
||||
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
|
13
tests/acceptance/_console.php
Normal file
13
tests/acceptance/_console.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require(__DIR__ . '/../../config/console.php'),
|
||||
require(__DIR__ . '/../_config.php'),
|
||||
[
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2_basic_acceptance',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
17
tests/acceptance/yii
Normal file
17
tests/acceptance/yii
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../_console_bootstrap.php';
|
||||
|
||||
$config = require(__DIR__ . '/_console.php');
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
20
tests/acceptance/yii.bat
Normal file
20
tests/acceptance/yii.bat
Normal file
@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
|
||||
rem -------------------------------------------------------------
|
||||
rem Yii command line bootstrap script for Windows.
|
||||
rem
|
||||
rem @author Qiang Xue <qiang.xue@gmail.com>
|
||||
rem @link http://www.yiiframework.com/
|
||||
rem @copyright Copyright © 2012 Yii Software LLC
|
||||
rem @license http://www.yiiframework.com/license/
|
||||
rem -------------------------------------------------------------
|
||||
|
||||
@setlocal
|
||||
|
||||
set YII_PATH=%~dp0
|
||||
|
||||
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
|
||||
|
||||
"%PHP_COMMAND%" "%YII_PATH%yii" %*
|
||||
|
||||
@endlocal
|
13
tests/functional/_console.php
Normal file
13
tests/functional/_console.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require(__DIR__ . '/../../config/console.php'),
|
||||
require(__DIR__ . '/../_config.php'),
|
||||
[
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2_basic_functional',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
17
tests/functional/yii
Normal file
17
tests/functional/yii
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../_console_bootstrap.php';
|
||||
|
||||
$config = require(__DIR__ . '/_console.php');
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
20
tests/functional/yii.bat
Normal file
20
tests/functional/yii.bat
Normal file
@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
|
||||
rem -------------------------------------------------------------
|
||||
rem Yii command line bootstrap script for Windows.
|
||||
rem
|
||||
rem @author Qiang Xue <qiang.xue@gmail.com>
|
||||
rem @link http://www.yiiframework.com/
|
||||
rem @copyright Copyright © 2012 Yii Software LLC
|
||||
rem @license http://www.yiiframework.com/license/
|
||||
rem -------------------------------------------------------------
|
||||
|
||||
@setlocal
|
||||
|
||||
set YII_PATH=%~dp0
|
||||
|
||||
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
|
||||
|
||||
"%PHP_COMMAND%" "%YII_PATH%yii" %*
|
||||
|
||||
@endlocal
|
13
tests/unit/_console.php
Normal file
13
tests/unit/_console.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return yii\helpers\ArrayHelper::merge(
|
||||
require(__DIR__ . '/../../config/console.php'),
|
||||
require(__DIR__ . '/../_config.php'),
|
||||
[
|
||||
'components' => [
|
||||
'db' => [
|
||||
'dsn' => 'mysql:host=localhost;dbname=yii2_basic_unit',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
17
tests/unit/yii
Normal file
17
tests/unit/yii
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Yii console bootstrap file.
|
||||
*
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../_console_bootstrap.php';
|
||||
|
||||
$config = require(__DIR__ . '/_console.php');
|
||||
|
||||
$application = new yii\console\Application($config);
|
||||
$exitCode = $application->run();
|
||||
exit($exitCode);
|
20
tests/unit/yii.bat
Normal file
20
tests/unit/yii.bat
Normal file
@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
|
||||
rem -------------------------------------------------------------
|
||||
rem Yii command line bootstrap script for Windows.
|
||||
rem
|
||||
rem @author Qiang Xue <qiang.xue@gmail.com>
|
||||
rem @link http://www.yiiframework.com/
|
||||
rem @copyright Copyright © 2012 Yii Software LLC
|
||||
rem @license http://www.yiiframework.com/license/
|
||||
rem -------------------------------------------------------------
|
||||
|
||||
@setlocal
|
||||
|
||||
set YII_PATH=%~dp0
|
||||
|
||||
if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
|
||||
|
||||
"%PHP_COMMAND%" "%YII_PATH%yii" %*
|
||||
|
||||
@endlocal
|
Loading…
x
Reference in New Issue
Block a user