spatie/phpunit-snapshot-assertions
Add snapshot testing to PHPUnit. Save expected output (JSON, arrays, strings, etc.) on first run and automatically compare on later runs to catch regressions with minimal assertions. Includes handy traits and snapshot update workflow for tests.
vendor/bin/update-snapshots wrapper binary that sets UPDATE_SNAPSHOTS=true and runs PHPUnit. This replaces the previously documented phpunit -d --update-snapshots syntax, which abused PHPUnit's -d flag and produces a Failed to set "--update-snapshots=1" test runner warning since PHPUnit 12.5.12.phpunit -d --without-creating-snapshots form from the README. Use the CREATE_SNAPSHOTS=false environment variable instead. The argv check is kept in shouldCreateSnapshots() for backwards compatibility.UPDATE_SNAPSHOTS env var state on shutdown, so it does not leak a state mutation to any in-process code that runs after PHPUnit.shouldUpdateSnapshots() and shouldCreateSnapshots() now check the env var first, then fall back to the legacy CLI argument.AssertionFailedError are tracked as a test failure even when user code catches the exception. The expectFail helper now uses a plain RuntimeException carrying the expected message.Closes #242.
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.3.2...5.4.0
getSnapshotId() from named snapshots feature — restored original no-parameter signatureFull Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.3.1...5.3.2
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.2.3...5.3.0
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.2.2...5.2.3
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.2.1...5.2.2
assertMatchesJsonSnapshot to accept any JSON-serializable value by @LuckyWindsck in https://github.com/spatie/phpunit-snapshot-assertions/pull/216Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.2.0...5.2.1
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.8...5.2.0
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.7...5.1.8
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.6...5.1.7
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.16...4.2.17
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.5...5.1.6
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.4...5.1.5
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.3...5.1.4
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.2...5.1.3
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.1.1...5.1.2
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.0.2...5.1.0
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/5.0.0...5.0.1
run-tests status in README.md by @gomzyakov in https://github.com/spatie/phpunit-snapshot-assertions/pull/160Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.16...5.0.0
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.15...4.2.16
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.14...4.2.15
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.13...4.2.14
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.12...4.2.13
LIBXML_HTML_NODEFDTD to maintain output consistency by @JayBizzle in https://github.com/spatie/phpunit-snapshot-assertions/pull/141Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.11...4.2.12
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.10...4.2.11
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.9...4.2.10
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.8...4.2.9
Full Changelog: https://github.com/spatie/phpunit-snapshot-assertions/compare/4.2.7...4.2.8
How can I help you explore Laravel packages today?