alies-dev/psalm-tester
Run Psalm assertions and traces as phpt test files inside PHPUnit. Write --FILE--/--EXPECT-- fixtures, use EXPECTF for flexible matching, pass custom Psalm arguments globally or per test via --ARGS--, and skip tests conditionally with --SKIPIF--.
PsalmPhptTestCase: implement phptDirectory() to get fixture discovery, SKIPIF handling, one batched Psalm run,
and PHPUnit --filter narrowing (only the selected fixtures are analyzed).Phpt, Expectation, PsalmTester::create() with with*() methods, and run() / runOne() returning a
Result with an Outcome, the formatted output and structured Issues.--XFAIL-- section: an expected failure reports as incomplete, and as a failure once it passes.withTimeout() kills a hung Psalm run with its child processes (on Windows, only the Psalm process itself) and
reports its tests as errors.withConcurrency(), withWorkingDirectory(), withEnv().--CONFLICTS-- section (php-src semantics): the fixture gets its own Psalm run, runs sharing a key never overlap,
and all runs alone. --DESCRIPTION-- and --CREDITS-- are accepted and ignored.missing and unexpected issues (with the code line) and CheckType
mismatches as expected versus actual type.PsalmPhptTestCase prints one start line on STDERR: psalm-tester: N phpt files (S skipped), G Psalm runs.vimeo/psalm (^6.10 || ^7.0.0-beta16) and composer-runtime-api (^2) are now required dependencies.--SKIPIF-- scripts run concurrently, Psalm runs go through a bounded process runner (no shell, one
run per argument set), and each run gets --no-cache with its own cache directory. psalm-plugin-laravel's type
suite (758 fixtures) went from 28.6s to about 10s wall time, and to about 4.6s with --filter on one test.--ARGS-- is appended to the configured arguments instead of replacing them; a --config in it replaces the
configured config.withArguments() takes one argument per parameter and --ARGS-- is split
into words.Duplicate section --X-- instead of silently replacing the earlier one. --CLEAN--,
--ENV-- and --INI-- get an explicit "not supported by psalm-tester" message.--EXPECT_EXTERNAL-- and --EXPECTF_EXTERNAL-- sections, now rejected as not supported: inline the expectation
into the .phpt file.showProgress parameter of create()).Upgrading from 0.3: see UPGRADING.md.
Full Changelog: https://github.com/alies-dev/psalm-tester/compare/0.3.0...0.4.0
--SKIPIF-- section support by @alies-dev in https://github.com/alies-dev/psalm-tester/pull/6Full Changelog: https://github.com/alies-dev/psalm-tester/compare/0.2.0...0.3.0
Full Changelog: https://github.com/alies-dev/psalm-tester/commits/0.2.0
How can I help you explore Laravel packages today?