SuperMenyII 2019-07-01
<?php
//定义模式
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__ . '/../common/config/bootstrap.php';
//配置信息,这里默认使用的为后台配置,可自行修改
$config = yii\helpers\ArrayHelper::merge(
//配置信息,数据库信息
require __DIR__ . '/../common/config/main.php',
require __DIR__ . '/../common/config/main-local.php',
require __DIR__ . '/../backend/config/main.php'
);
//(new yii\web\Application($config))->run() ;
//注册框架基本服务,不运行框架
(new yii\web\Application($config)) ;
//所有测试文件 以 Test.php结尾 eg: UnitTest.php
//所有测试方法 以 test开头 eg: testPay()
//测试 以index.php为运行组件运行测试文件
//window + R 输入 cmd ;
//进入到项目中的test文件夹
//运行:phpunit --bootstrap ./index.php demo/UnitTest
//解释:使用 phpunit 以 index.php 为组件,运行 demo 文件夹下的 UnitTest.php 中的所有测试代码目录结构如下 :
