webmaesther/pest-plugin-contract 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

webmaesther/pest-plugin-contract

Composer 安装命令:

composer require --dev webmaesther/pest-plugin-contract

包简介

Pest plugin to define contract tests

README 文档

README

This repository contains the Pest Plugin Contract.

If you want to start testing your application with Pest, visit the main Pest Repository.

Requirements

  • Pest v4

Installation

composer require webmaesther/pest-plugin-contract --dev

Usage

Define your contracts anywhere in your test folder in *Contract.php files.

contract('is string', function() {
    
    test('its type is string', function(mixed $value) {
    
        expect($value)->toBeString();
    })
});

Then you can use your contracts in any of your test files.

fulfill('is string')->with(['string']);

The fullfill function simply creates a describe block out of your contract closure, and includes it in your test file, exactly where you put it, as if you yourself would have written it. Thus, you can use any method on it that you would use on a describe block. Most notably you will need the with() method, which you should use to parametrize your tests with any Pest compatible dataset you like.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固