{"id":22266826,"url":"https://github.com/qbhy/hyperf-testing","last_synced_at":"2025-10-24T10:01:54.498Z","repository":{"id":57046227,"uuid":"281280867","full_name":"qbhy/hyperf-testing","owner":"qbhy","description":"hyperf框架的测试用例扩展","archived":false,"fork":false,"pushed_at":"2020-07-21T03:53:48.000Z","size":8,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-07T03:17:48.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qbhy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-21T03:02:42.000Z","updated_at":"2021-11-08T06:13:37.000Z","dependencies_parsed_at":"2022-08-24T03:40:32.475Z","dependency_job_id":null,"html_url":"https://github.com/qbhy/hyperf-testing","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/qbhy/hyperf-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbhy%2Fhyperf-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbhy%2Fhyperf-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbhy%2Fhyperf-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbhy%2Fhyperf-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qbhy","download_url":"https://codeload.github.com/qbhy/hyperf-testing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbhy%2Fhyperf-testing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267502696,"owners_count":24098202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T10:24:11.214Z","updated_at":"2025-10-24T10:01:54.419Z","avatar_url":"https://github.com/qbhy.png","language":"PHP","readme":"# qbhy/hyperf-testing\n该扩展包可以提供和 `laravel` 几乎一致的测试用例书写体验\n\n## 安装 - install\n```bash\n$ composer require qbhy/hyperf-testing\n```\n\n## 使用 - usage\n1. 修改 `HyperfTest\\HttpTestCase` 的 `$client`，把默认的 `Client` 改成 `Qbhy\\HyperfTesting\\Client`\n2. 修改测试用例\n```php\n\u003c?php\n\nnamespace HyperfTest\\Cases\\Dev;\n\nuse HyperfTest\\HttpTestCase;\nuse Qbhy\\HyperfTesting\\Client;\nuse Qbhy\\HyperfTesting\\TestResponse;\n\n/**\n * Class DevTest\n * @method TestResponse get($uri, $data = [], $headers = [])\n * @method TestResponse post($uri, $data = [], $headers = [])\n * @method TestResponse delete($uri, $data = [], $headers = [])\n * @method TestResponse put($uri, $data = [], $headers = [])\n * @method TestResponse json($uri, $data = [], $headers = [])\n * @method TestResponse file($uri, $data = [], $headers = [])\n * @package HyperfTest\\Cases\\Dev\n */\nclass DevTest extends HttpTestCase\n{\n    public function __construct($name = null, array $data = [], $dataName = '')\n    {\n        parent::__construct($name, $data, $dataName);\n        $this-\u003eclient = make(Client::class);\n    }\n\n    public function testExample()\n    {\n        $this-\u003eget('/')-\u003eassertOk()-\u003eassertJsonStructure([\n            'data', 'code', 'message',\n        ]);\n    }\n}\n```\n\u003e 暂不支持 cookie 和 session 相关的断言！\n\n## 声明 - statement\n该包大量参考了 laravel 的代码。感谢 laravel 实现了那么好用的测试用例组件。\n\nhttps://github.com/qbhy/hyperf-testing  \n96qbhy@qq.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbhy%2Fhyperf-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqbhy%2Fhyperf-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbhy%2Fhyperf-testing/lists"}