PHPackages                             soyhuce/pest-plugin-laravel - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. soyhuce/pest-plugin-laravel

ActiveLibrary[Testing &amp; Quality](/categories/testing)

soyhuce/pest-plugin-laravel
===========================

Custom extensions for Laravel integration into Pest

1.1.0(2mo ago)02.0kMITPHPPHP ^8.4CI passing

Since Jun 11Pushed 2mo agoCompare

[ Source](https://github.com/Soyhuce/pest-plugin-laravel)[ Packagist](https://packagist.org/packages/soyhuce/pest-plugin-laravel)[ RSS](/packages/soyhuce-pest-plugin-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

Pest plugin for Laravel development
===================================

[](#pest-plugin-for-laravel-development)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f6b6e957eea5e1999f500fd40dcc11b0542db77dbc839c2c5e0e0b8cce19321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f79687563652f706573742d706c7567696e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soyhuce/pest-plugin-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f9e595f716b244e4623b1aba50198ae631cfeeb0ec18aaf48f4c06b6701805d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f706573742d706c7567696e2d6c61726176656c2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/soyhuce/pest-plugin-laravel/actions/workflows/tests.yml)[![GitHub static analysis Action Status](https://camo.githubusercontent.com/1e77a53cfd45a5244bfc94a8c1622d085fe4ef1126a68d9363daf2c0c39ea0d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f706573742d706c7567696e2d6c61726176656c2f7374617469632e796d6c3f6272616e63683d6d61696e266c6162656c3d737461746963267374796c653d666c61742d737175617265)](https://github.com/soyhuce/pest-plugin-laravel/actions/workflows/static.yml)[![GitHub Pint Action Status](https://camo.githubusercontent.com/e826f6041740d65a1df3f95daf90061b199dbe887054e86afff521297aa34651/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f79687563652f706573742d706c7567696e2d6c61726176656c2f70696e742e796d6c3f6272616e63683d6d61696e266c6162656c3d70696e74267374796c653d666c61742d737175617265)](https://github.com/soyhuce/pest-plugin-laravel/actions/workflows/pint.yml)[![Total Downloads](https://camo.githubusercontent.com/39107dad8aad7f814453982e23da111de59c4518925fb1b45cfa871b800049b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f79687563652f706573742d706c7567696e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soyhuce/pest-plugin-laravel)

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

[](#installation)

You can install the package via composer:

```
composer require soyhuce/pest-plugin-laravel --dev
```

Usage
-----

[](#usage)

### Expectations

[](#expectations)

- `toBeModel` expects that the value matches current model

```
expect($model)->toBeModel($expectedModel)
```

- `toBeCollection` expects that the collection matches current collection

```
expect($collection)->toBeCollection(new Collection([1,2,3]));
/// Expected collection can be given as array
expect($collection)->toBeCollection([1,2,3]);
```

Keys and order of the collections are checked and must match.

- `toBeCollectionCanonicalizing` expects that the collection matches current collection, ignoring order

```
expect($collection)->toBeCollectionCanonicalizing(new Collection([1,2,3]));
/// Expected collection can be given as array
expect($collection)->toBeCollectionCanonicalizing([3,1,2]);
```

Keys of the collections are checked and must match.

- `toBeAbleTo` expect that the autenticatable can perform the given action

```
expect($user)->toBeAbleTo('update', $post);
```

#### Data expectations : require `spatie/laravel-data` package

[](#data-expectations--require-spatielaravel-data-package)

- `toBeData` expects that the value matches current data object

```
expect($data)->toBeData(new UserData(['name' => 'John Doe']));
```

- `toBeDataCollection` expects that the collection matches current data collection

```
expect($dataCollection)->toBeDataCollection(new UserDataCollection([
    new UserData(['name' => 'John Doe']),
    new UserData(['name' => 'Jane Doe']),
]));

// Expected collection can be given as array
expect($dataCollection)->toBeDataCollection([['name' => 'John Doe'], ['name' => 'Jane Doe']]);
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Every ~261 days

Total

2

Last Release

74d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/206cfbf866a463f7e7d1e86946d59b82f4191b9c89f9981fb03eeb264d77af79?d=identicon)[SoyHuCe](/maintainers/SoyHuCe)

---

Top Contributors

[![bastien-phi](https://avatars.githubusercontent.com/u/10199039?v=4)](https://github.com/bastien-phi "bastien-phi (4 commits)")[![tnajah59](https://avatars.githubusercontent.com/u/91531929?v=4)](https://github.com/tnajah59 "tnajah59 (1 commits)")

---

Tags

phpplugintestingunittestpestlaravel

### Embed Badge

![Health badge](/badges/soyhuce-pest-plugin-laravel/health.svg)

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

###  Alternatives

[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[pestphp/pest-plugin-drift

The Pest Drift Plugin

734.0M74](/packages/pestphp-pest-plugin-drift)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[jonpurvis/lawman

A PestPHP Plugin to help with architecture testing SaloonPHP integrations

4027.7k8](/packages/jonpurvis-lawman)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[milroyfraser/pest-plugin-gwt

Given When Then(GWT) Plugin for Pest

10332.1k1](/packages/milroyfraser-pest-plugin-gwt)

PHPackages © 2026

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