What's Changed
- Add
vendor/bin/update-snapshotswrapper binary that setsUPDATE_SNAPSHOTS=trueand runs PHPUnit. This replaces the previously documentedphpunit -d --update-snapshotssyntax, which abused PHPUnit's-dflag and produces aFailed to set "--update-snapshots=1"test runner warning since PHPUnit 12.5.12. - Drop the
phpunit -d --without-creating-snapshotsform from the README. Use theCREATE_SNAPSHOTS=falseenvironment variable instead. The argv check is kept inshouldCreateSnapshots()for backwards compatibility. - The wrapper restores the prior
UPDATE_SNAPSHOTSenv var state on shutdown, so it does not leak a state mutation to any in-process code that runs after PHPUnit. - Reworded the "Snapshot does not exist" failure message and the "snapshots can be updated by..." prompt to point at the new approach.
shouldUpdateSnapshots()andshouldCreateSnapshots()now check the env var first, then fall back to the legacy CLI argument.- Fix tests on PHPUnit 12.5+, where mocks throwing
AssertionFailedErrorare tracked as a test failure even when user code catches the exception. TheexpectFailhelper now uses a plainRuntimeExceptioncarrying the expected message.
Closes #242.
Full Changelog: 5.3.2...5.4.0