youbar / phpunit-snapshot-assertions
An extension of the spatie/phpunit-snapshot-assertions package.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
pkg:composer/youbar/phpunit-snapshot-assertions
Requires
This package is not auto-updated.
Last update: 2025-10-25 14:27:05 UTC
README
An extension of the spatie/phpunit-snapshot-assertions package. This package adds assertJsonStructureSnapshot() method that only compares JSON keys, so the values can be different and the test will still pass.
Installation
composer require --dev owowagency/phpunit-snapshot-assertions
Usage
use OwowAgency\Snapshots\MatchesSnapshots;
class OrderTest
{
use MatchesSnapshots;
public function test_it_casts_to_json()
{
$order = new Order(1);
$this->assertJsonStructureSnapshot($order->toJson());
}
}