ThinkPHP6 use PHPUnit
ThinkPHP6使用PHPUnit
- phpunit可以给PHPStorm指定phpunit的路径
- 可以通过php think unit执行命令
- BaseTestCase是测试基类,继承phpunit的测试基类,并提供ThinkPHP6专用方法
- 继承\aogg\phpunit\think\BaseTestCase基类
- 支持项目软连接情况下运行单元测试
composer require aogg/think-phpunit:^v0.3
支持测试类中调用控制器的方法
/**
* 商品列表
*
* @return array|mixed
*/
public function testStoreVerifyFinishList()
{
$data = $this->get($this->getRequestUrlString('product/list', ['limit' => 1]));
return $data;
}


{
"repositories": [
{
"type": "path",
"url": "/app/origin/my/github/composer-PHPUnit-ThinkPHP"
}
]
}
composer require aogg/think-phpunit:dev-master