Merge pull request #2383 from Ragazzo/add_yii_command_to_tests

added yii console command to tests
This commit is contained in:
Qiang Xue 2014-02-15 11:32:07 -05:00
commit 24151471d5
10 changed files with 162 additions and 0 deletions

View 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');

View 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
View 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
View 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 &copy; 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

View 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
View 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
View 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 &copy; 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
View 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
View 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
View 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 &copy; 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