PHPackages                             holgerk/pest-plugin-equal-golden - 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. holgerk/pest-plugin-equal-golden

ActiveLibrary[Framework](/categories/framework)

holgerk/pest-plugin-equal-golden
================================

Provides a toEqualGolden assertion, same as toEqual, but when null is given as argument, the test file is automatically edited and null is substituted with the actual value

v1.0.1(2y ago)12MITPHPPHP ^8.2

Since Mar 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/holgerk/pest-plugin-equal-golden)[ Packagist](https://packagist.org/packages/holgerk/pest-plugin-equal-golden)[ RSS](/packages/holgerk-pest-plugin-equal-golden/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Golden Testing for [Pest](https://pestphp.com)
==============================================

[](#golden-testing-for-pest)

[![run-tests](https://github.com/holgerk/pest-plugin-equal-golden/actions/workflows/tests.yml/badge.svg)](https://github.com/holgerk/pest-plugin-equal-golden/actions/workflows/tests.yml)

Provides a `toEqualGolden` assertion, same as `toEqual`, but when `null` is given as argument, the test file is automatically edited and `null` is substituted with the actual value.

So, if you add:

```
expect(['color' => 'golden'])
    ->toEqualGolden(null);
```

...to your test and execute it. The `null` expression is replaced by the actual value:

```
expect(['color' => 'golden'])
    ->toEqualGolden(['color' => 'golden']);
```

In principle, it's about saving oneself the recurring work of writing, updating and copying an expectation.

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

[](#installation)

You can install the package via composer:

```
composer require holgerk/pest-plugin-equal-golden --dev
```

Usage
-----

[](#usage)

Just pass `null` to the `toEqualGolden` expectation and `null` will be automatically replaced during the first test run.

```
expect($actual)->toEqualGolden(null);
```

Later you can edit the expectation by hand or insert `null` again to have it automatically replaced.
If you want to regenerate all expectations at once you can add the argument: `--update-golden` to your pest invocation.

```
# regenerate all expectations at once from their actual values
./vendor/bin/pest --update-golden
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

See Also
--------

[](#see-also)

- [pest-plugin-snapshots](https://github.com/spatie/pest-plugin-snapshots)
    This plugin also facilitates the automatic generation of expectations from the actual value, but it will store the generated expectation in separate files.

Credits
-------

[](#credits)

- [Nuno Maduro](https://github.com/nunomaduro)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Every ~4 days

Total

3

Last Release

763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e55c03dc164181c5860898403302c95e31822e3610dc02027b1adc89269180d?d=identicon)[holgerk](/maintainers/holgerk)

---

Top Contributors

[![holgerk](https://avatars.githubusercontent.com/u/1426236?v=4)](https://github.com/holgerk "holgerk (14 commits)")

---

Tags

phpplugintestingunitframeworktestpest

### Embed Badge

![Health badge](/badges/holgerk-pest-plugin-equal-golden/health.svg)

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

###  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-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)[ozzie/pest-plugin-nest

Nest Pest PHP tests for better organization and readability

2028.3k](/packages/ozzie-pest-plugin-nest)

PHPackages © 2026

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