New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

alies-dev/psalm-plugin-pest

Psalm plugin for Pest: types $this in test closures as the configured TestCase (with its traits and beforeEach() properties), resolves expectation and higher-order test chains, narrows types after expect() and accepts Pest's public API.
21,145 2

Larablocks Analysis

alies-dev/psalm-plugin-pest works with any PHP project: the latest release (1.0.1, Nov 21, 2026) doesn't depend on Laravel.

Recommendation checks

Use with care

Use with care: meets 2 of 4 checks.

  • Released in the last 12 months (Nov 21, 2026)
  • First released under 90 days ago
  • 20,884 downloads a month (at least 10,000)
  • 2 GitHub stars (needs 100)

State

Too new to judge
  • Last stable release: Nov 21, 2026.
  • 12 releases in the last 12 months.
  • First released: Sep 30, 2026.
  • Monthly downloads: 20,884.
  • 4 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require alies-dev/psalm-plugin-pest
Latest Version:1.0.1
PHP:^8.3
License:MIT
Last Updated:Nov 21, 2026
Links: GitHub  ·  Packagist
Maintainer: alies-dev

psalm-plugin-pest: makes Psalm understand Pest tests

Your Pest tests, fully typed. Bugs contained.

Latest version Downloads License Psalm type coverage Psalm level

This plugin teaches Psalm how Pest really works. Keep your tests in the analysis, get real types and catch broken tests before you run them.

Install

Requires Psalm 7.6+ and Pest 4.5+ or 5.

composer require --dev alies-dev/psalm-plugin-pest
vendor/bin/psalm-plugin enable alies-dev/psalm-plugin-pest

That's it. Make sure tests/ is in <projectFiles> of your psalm.xml.

Before and after

uses(Tests\TestCase::class);

beforeEach(function () {
    $this->cart = new Cart();
});

it('totals the cart', function () {
    $this->actingAs(admin());       // before: TestCall::__call(), unchecked
                                    // after:  Tests\TestCase::actingAs()

    $total = $this->cart->total();  // before: TestCall, so $total is TestCall
                                    // after:  Cart from beforeEach(), int

    expect($total)->toBeString();   // after:  PestImpossibleExpectation,
});                                 //         total() returns int

Found a false positive? Open an issue with a snippet.

License

MIT, see LICENSE.

Alternatives to alies-dev/psalm-plugin-pest

laravel/pao

Agent-optimized output for PHP testing tools

36,386,213 736
psalm/plugin-laravel

Psalm plugin for Laravel

7,549,646 352
spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

121,047 141
odinns/phpstan-pest-this

PHPStan extensions to infer Pest closure $this type from test file mappings.

4,658 1
ianrodrigues/pest-plugin-code-quality

Method-level and class-level maintainability limits (complexity, body lines, par...

586 4

Version History

Version Released PHP License
1.0.1 ^8.3 MIT
1.0.0 ^8.3 MIT
0.5.0 ^8.3 MIT
0.4.0 ^8.3 MIT
0.3.0 ^8.3 MIT
Pre-releases (2)
Version Released PHP License
1.0.0-rc.2 ^8.3 MIT
1.0.0-rc.1 ^8.3 MIT