zt/unit-test
Composer 安装命令:
composer require zt/unit-test
包简介
Thinkphp Unit Test
关键字:
README 文档
README
一个为ThinkPHP打造的的UnitTest,简单易用、高效便捷。
##How To Use
详细使用介绍查看项目example,下面列出一个简单的使用介绍
- 在
Application目录下创建Test/Controller,编写测试Controller。 - 以编写 IndexController为例:
namespace \Test\Controller; class IndexController extends UnitTest{ /** * 调用方法: * 1. http://localhost/PROJECT_NAME/index.php?m=Test 自动执行全部测试文件 * 2. http://localhost/PROJECT_NAME/index.php?m=Test&controller=XXX 自动执行参数crontroller指定的文件 */ function index(){ $this->run(true); //测试方式1 : 通过自动遍历测试文件的方式执行测试 } function index2(){ $this->setController( array(__CLASS__ ,'\OtherClassName') ); //测试方式2 :设置将要执行的测试类 $this->run(); //执行测试代码 } function testExample1(){ //该方法将自动被测试 $this->assertTrue(true); $this->assertFalse(false); } function testExample2(){ //该方法将自动被测试 $this->assertEmpty(null); $this->assertNotEmpty(true); } }
##Bug && Contact Author
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-12
