PHPackages                             webmaesther/pest-plugin-contract - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. webmaesther/pest-plugin-contract

ActiveLibrary[Framework](/categories/framework)

webmaesther/pest-plugin-contract
================================

Pest plugin to define contract tests

4.x-dev(9mo ago)0234MITPHPPHP ^8.3CI passing

Since Sep 18Pushed 9mo agoCompare

[ Source](https://github.com/webmaesther/pest-plugin-contract)[ Packagist](https://packagist.org/packages/webmaesther/pest-plugin-contract)[ Fund](https://revolut.me/itesz)[ RSS](/packages/webmaesther-pest-plugin-contract/feed)WikiDiscussions 4.x Synced 3w ago

READMEChangelogDependencies (4)Versions (1)Used By (0)

Contract Plugin for Pest PHP
============================

[](#contract-plugin-for-pest-php)

This repository contains the Pest Plugin Contract.

> If you want to start testing your application with Pest, visit the main **[Pest Repository](https://github.com/pestphp/pest)**.

Requirements
------------

[](#requirements)

- Pest v4

Installation
------------

[](#installation)

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

Usage
-----

[](#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.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance57

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

282d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/206240807?v=4)[webmaesther](/maintainers/webmaesther)[@webmaesther](https://github.com/webmaesther)

---

Top Contributors

[![eszterczotter](https://avatars.githubusercontent.com/u/9593919?v=4)](https://github.com/eszterczotter "eszterczotter (16 commits)")

---

Tags

phpplugintestingunitframeworktestpest

### Embed Badge

![Health badge](/badges/webmaesther-pest-plugin-contract/health.svg)

```
[![Health](https://phpackages.com/badges/webmaesther-pest-plugin-contract/health.svg)](https://phpackages.com/packages/webmaesther-pest-plugin-contract)
```

###  Alternatives

[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98585.1k7](/packages/defstudio-pest-plugin-laravel-expectations)[jonpurvis/lawman

A PestPHP Plugin to help with architecture testing SaloonPHP integrations

4134.4k9](/packages/jonpurvis-lawman)[pestphp/pest-plugin-arch

The Arch plugin for Pest PHP.

4253.7M5.1k](/packages/pestphp-pest-plugin-arch)[pestphp/pest-plugin-browser

Pest plugin to test browser interactions

1312.9M151](/packages/pestphp-pest-plugin-browser)[pestphp/pest-plugin-type-coverage

The Type Coverage plugin for Pest PHP.

353.9M983](/packages/pestphp-pest-plugin-type-coverage)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

68943.9k18](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
