Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qbhy/hyperf-testing

hyperf框架的测试用例扩展
https://github.com/qbhy/hyperf-testing

Last synced: 20 days ago
JSON representation

hyperf框架的测试用例扩展

Awesome Lists containing this project

README

        

# qbhy/hyperf-testing
该扩展包可以提供和 `laravel` 几乎一致的测试用例书写体验

## 安装 - install
```bash
$ composer require qbhy/hyperf-testing
```

## 使用 - usage
1. 修改 `HyperfTest\HttpTestCase` 的 `$client`,把默认的 `Client` 改成 `Qbhy\HyperfTesting\Client`
2. 修改测试用例
```php
client = make(Client::class);
}

public function testExample()
{
$this->get('/')->assertOk()->assertJsonStructure([
'data', 'code', 'message',
]);
}
}
```
> 暂不支持 cookie 和 session 相关的断言!

## 声明 - statement
该包大量参考了 laravel 的代码。感谢 laravel 实现了那么好用的测试用例组件。

https://github.com/qbhy/hyperf-testing
[email protected]