Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qbhy/hyperf-testing
hyperf框架的测试用例扩展
https://github.com/qbhy/hyperf-testing
Last synced: 20 days ago
JSON representation
hyperf框架的测试用例扩展
- Host: GitHub
- URL: https://github.com/qbhy/hyperf-testing
- Owner: qbhy
- License: mit
- Created: 2020-07-21T03:02:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-21T03:53:48.000Z (over 4 years ago)
- Last Synced: 2024-08-18T05:31:14.184Z (4 months ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 8
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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]