PHPackages                             milroyfraser/pest-plugin-gwt - 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. milroyfraser/pest-plugin-gwt

ActiveLibrary[Framework](/categories/framework)

milroyfraser/pest-plugin-gwt
============================

Given When Then(GWT) Plugin for Pest

v2.0.0(1y ago)10332.1k—0%4[1 PRs](https://github.com/milroyfraser/pest-plugin-gwt/pulls)1MITPHPPHP ^8.2

Since Mar 10Pushed 1y ago5 watchersCompare

[ Source](https://github.com/milroyfraser/pest-plugin-gwt)[ Packagist](https://packagist.org/packages/milroyfraser/pest-plugin-gwt)[ Fund](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L)[ GitHub Sponsors](https://github.com/nunomaduro)[ RSS](/packages/milroyfraser-pest-plugin-gwt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

Given When Then (GWT) Plugin for Pest
=====================================

[](#given-when-then-gwt-plugin-for-pest)

> A simple API allows you to structure your tests focused on the behaviour. Given-When-Then separation makes the test easier to understand at a glance.

### Install

[](#install)

```
composer require milroyfraser/pest-plugin-gwt --dev
```

### Usage

[](#usage)

```
use App\Exceptions\BlockedUserException;
use App\Models\User;
use function Pest\Gwt\scenario;
use function Pest\Laravel\assertDatabaseHas;

scenario('activate user')
    ->given(fn() => User::factory()->create())
    ->when(fn(User $user) => $user->activate())
    ->then(fn(User $user) => assertDatabaseHas('users', [
        'id' => $user->id,
        'activated' => true,
    ]));

scenario('activate blocked user')
    ->given(fn() => User::factory()->blocked()->create())
    ->when(fn(User $user) => $user->activate())
    ->throws(BlockedUserException::class);
```

[more examples](https://github.com/milroyfraser/pest-plugin-gwt/blob/master/tests/Example.php)

**Given** a state

Given method accepts a `Closure`. This is where we `Arrange` application state. The return values will become argument/s of the `when` closure.

**When** I do something

When method accepts a `Closure`. This is where we `Act` (perform) the operation. The return values will become argument/s of the `then` closure.

**Then** I expect an outcome

Then method accepts a `Closure`. This is where we `Assert` the outcome.

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

- Explore the docs: **[pestphp.com/docs/plugins/creating-plugins »](https://pestphp.com/docs/plugins/creating-plugins)**
- Follow us on Twitter: **[@pestphp »](https://twitter.com/pestphp)**
- Join us on the Discord Server: **[discord.gg/bMAJv82 »](https://discord.gg/bMAJv82)**

Pest was created by **[Nuno Maduro](https://twitter.com/enunomaduro)** under the **[Sponsorware license](https://github.com/sponsorware/docs)**. It got open-sourced and is now licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~310 days

Total

4

Last Release

600d ago

Major Versions

0.0.3 → 1.0.02023-02-12

1.0.0 → v2.0.02024-09-26

PHP version history (3 changes)0.0.2PHP ^7.3 || ^8.0

1.0.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f3ba1935044647e51c405868792beea05a76250a8f7ef408c9b706edf51fcb6?d=identicon)[milroy.me](/maintainers/milroy.me)

---

Top Contributors

[![milroyfraser](https://avatars.githubusercontent.com/u/3282475?v=4)](https://github.com/milroyfraser "milroyfraser (12 commits)")[![jradtilbrook](https://avatars.githubusercontent.com/u/6128798?v=4)](https://github.com/jradtilbrook "jradtilbrook (4 commits)")

---

Tags

phpplugintestingunitframeworktestpestgwtaaa

### Embed Badge

![Health badge](/badges/milroyfraser-pest-plugin-gwt/health.svg)

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

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

Nest Pest PHP tests for better organization and readability

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

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

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