PHPackages                             ralphjsmit/pest-plugin-livewire - 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. ralphjsmit/pest-plugin-livewire

AbandonedArchivedLibrary[Framework](/categories/framework)

ralphjsmit/pest-plugin-livewire
===============================

A plugin for Pest to test Livewire forms.

2.0(3y ago)024.7k1MITPHPPHP ^8.0

Since Jan 11Pushed 2y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

Test your Livewire forms with Pest
==================================

[](#test-your-livewire-forms-with-pest)

This package provides a convenient way to test your Livewire forms and speed up your workflow. It adds helpers that make repetitive tasks faster, like testing whether properties are required or not.

Important

This package works only with Livewire V2 and up to Laravel 10. Therefore, it will not be updated to support Livewire V3 and/or Laravel 11 or higher. The repository will be archived.

Contents
--------

[](#contents)

1. Expectations
    1. [expect(...)-&gt;toHaveRequiredProperties()](#expect-tohaverequiredproperties)
    2. [expect(...)-&gt;toNotHaveRequiredProperties()](#expect-tonothaverequiredproperties)
2. Functions
    1. [assertRequiredProperties(...)](#assertrequiredproperties)
    2. [assertNotRequiredProperties(...)](#assertnotrequiredproperties)
    3. [validInput(...)](#validinput)

Expectations
------------

[](#expectations)

### expect(...)-&gt;toHaveRequiredProperties()

[](#expect-tohaverequiredproperties)

Test whether Livewire properties are required. Consider the following dummy Livewire component:

```
class TestRequiredPropertiesComponent extends Component
{
    public string $email_Req = '';
    public string $email = '';
    public ?int $age_Req = null;
    public ?int $age = null;

    protected array $rules = [
        'email' => '',
        'email_Req' => 'required',
        'age' => 'numeric',
        'age_Req' => 'numeric|required',
    ];

    public function render(): string
    {
        return '';
    }

    public function submit()
    {
        $this->validate();
    }
```

```
use function RalphJSmit\PestPluginLivewire\validInput;

$component = Livewire::test(TestRequiredPropertiesComponent::class);

$validInput = validInput([
    'email' => 'alex@example.com',
    'age' => 25,
]);

expect($component)
    ->toHaveRequiredProperties(validInput, ['email_Req', 'age_Req'], 'submit');
```

> **NB.:** Using `->not` to negate the test is currently **not yet supported**.

### expect(...)-&gt;toNotHaveRequiredProperties()

[](#expect-tonothaverequiredproperties)

Test whether Livewire properties aren't required. Let's continue the example from above with a test for the properties that are not required:

```
use function RalphJSmit\PestPluginLivewire\validInput;

$component = Livewire::test(TestRequiredPropertiesComponent::class);

$validInput = validInput([
    'email' => 'alex@example.com',
    'age' => 25,
]);

expect($component)
    ->toNotHaveRequiredProperties(validInput, ['email', 'name'], 'submit');
```

> **NB.:** Using `->not` to negate the test is currently **not yet supported**.

Functions
---------

[](#functions)

### assertRequiredProperties()

[](#assertrequiredproperties)

Use this function to test whether Livewire properties are required. Consider using an `expect(...)` call if you want to chain multiple expectations:

```
use function RalphJSmit\PestPluginLivewire\assertRequiredProperties;

assertRequiredProperties(TestableLivewire $livewire, Collection $validInput, array $requiredProperties, string $submitFunction);
```

### assertNotRequiredProperties()

[](#assertnotrequiredproperties)

Use this function to test whether Livewire properties aren't required. Consider using an `expect(...)` call if you want to chain multiple expectations:

```
use function RalphJSmit\PestPluginLivewire\assertNotRequiredProperties;

assertNotRequiredProperties(TestableLivewire $livewire, Collection $validInput, array $requiredProperties, string $submitFunction);
```

### validInput()

[](#validinput)

Use this function to get a `ValidInput` object (Laravel Collection). It's needed for using the above functions.

General
-------

[](#general)

🐞 If you spot a bug, please submit a detailed issue and I'll try to fix it as soon as possible.

🔐 If you discover a vulnerability, please review [our security policy](../../security/policy).

🙌 If you want to contribute, please submit a pull request. All PRs will be fully credited. If you're unsure whether I'd accept your idea, feel free to contact me!

🙋‍♂️ [Ralph J. Smit](https://ralphjsmit.com)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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 ~77 days

Recently: every ~108 days

Total

7

Last Release

1118d ago

Major Versions

1.3.0 → 2.02023-04-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59207045?v=4)[Ralph J. Smit](/maintainers/ralphjsmit)[@ralphjsmit](https://github.com/ralphjsmit)

---

Top Contributors

[![ralphjsmit](https://avatars.githubusercontent.com/u/59207045?v=4)](https://github.com/ralphjsmit "ralphjsmit (31 commits)")

---

Tags

phpplugintestingunitframeworktestpest

### Embed Badge

![Health badge](/badges/ralphjsmit-pest-plugin-livewire/health.svg)

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

###  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-livewire

The Pest Livewire Plugin

635.6M541](/packages/pestphp-pest-plugin-livewire)[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)
