定制 quillphp/testing 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

quillphp/testing

最新稳定版本:0.0.1

Composer 安装命令:

composer require --dev quillphp/testing

包简介

Professional testing utilities for the Quill PHP framework

README 文档

README

Fluent testing utilities for the Quill PHP Framework, making it easy to test your handlers and middleware without full HTTP round-trips.

This package provides a TestClient that wraps the internal App::handle() lifecycle, allowing you to simulate requests and assert on the results with a clean, expressive API.

Installation

composer require quillphp/testing

Usage

Getting Started

To test your application, create a TestClient instance passing your App kernel:

use Quill\Testing\TestClient;

class UserTest extends \PHPUnit\Framework\TestCase {
    public function test_it_returns_user_data() {
        $app = new \Quill\App();
        // ... set up routes ...
        
        $client = new TestClient($app);
        
        $client->get('/users/1')
            ->assertStatus(200)
            ->assertJson(['id' => 1, 'name' => 'John']);
    }
}

TestClient Methods

The TestClient supports all standard HTTP methods:

  • $client->get(string $uri, array $headers = [])
  • $client->post(string $uri, array $data = [], array $headers = [])
  • $client->put(string $uri, array $data = [], array $headers = [])
  • $client->patch(string $uri, array $data = [], array $headers = [])
  • $client->delete(string $uri, array $data = [], array $headers = [])

TestResponse Assertions

The response returned by the client allows for fluent assertions:

Method Description
assertStatus(int $code) Asserts the HTTP status code.
assertJson(array $subset) Asserts that the response body contains the given JSON subset.
assertHeader(string $name, string $value) Asserts a specific header value.
assertSee(string $string) Asserts that the response body contains the given string.

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固