Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owowagency/phpunit-snapshot-assertions
An extension of the spatie/phpunit-snapshot-assertions package.
https://github.com/owowagency/phpunit-snapshot-assertions
Last synced: 3 months ago
JSON representation
An extension of the spatie/phpunit-snapshot-assertions package.
- Host: GitHub
- URL: https://github.com/owowagency/phpunit-snapshot-assertions
- Owner: owowagency
- Created: 2019-10-07T11:35:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-25T13:14:19.000Z (over 1 year ago)
- Last Synced: 2024-10-07T05:44:14.393Z (4 months ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# phpunit-snapshot-assertions
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());
}
}
```