定制 rezak/pest-test-helpers 二次开发

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

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

rezak/pest-test-helpers

Composer 安装命令:

composer require --dev rezak/pest-test-helpers

包简介

Custom Pest assertions for Laravel

README 文档

README

A custom Laravel package that extends Pest with additional assertions to make testing routes and requests easier. This package includes assertions like assertrouteCanSeeFormRequest to simplify testing route accessibility in your Laravel application.

Installation

You can install this package via Composer.

1. Add Package to Your Laravel Project

Run the following command to add the package to your Laravel project:

composer require rezak/pest-test-helpers --dev

Usage

This package adds custom assertions for easier testing of routes and requests. Here's an example of how to use the assertrouteCanSeeFormRequest assertion in your tests:

it('can see the request for the test route', function () {
    class CustomRequest {}

    Route::get('/test-route', fn(CustomRequest $request) => []);

    // Assert that the route '/test-route' can see the request
    $this->assertrouteCanSeeFormRequest('test-route', CustomRequest::class);
});

In this example, the test checks if the custom request class (CustomRequest) is correctly injected when hitting the route /test-route. The assertion ensures that the request can be seen by the route.

Available Assertions

  • assertrouteCanSeeFormRequest: Verifies that a specific request class can be seen by a given route.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固