phpunit-snapshot-assertions
A way to test without writing actual test cases
File Explorer
Download Latest Version (.zip)- config.yml
- dependabot-auto-merge.yml
- pint.yml
- run-tests.yml
- update-changelog.yml
- dependabot.yml
- FUNDING.yml
- _run-phpunit.php
- update-snapshots
- Order.php
- OrderLine.php
- OrderSerializer.php
- OrderSerializerTest__it_can_serialize_an_order__1.json
- OrderSerializerTest.php
- composer.json
- phpunit.xml
- PhpUnitCompatibility.php
- SnapshotDirectoryAware.php
- SnapshotIdAware.php
- HtmlDriver.php
- ImageDriver.php
- JsonDriver.php
- ObjectDriver.php
- TextDriver.php
- XmlDriver.php
- YamlDriver.php
- CantBeSerialized.php
- Driver.php
- Filename.php
- Filesystem.php
- MatchesSnapshots.php
- Snapshot.php
- .gitignore
- AssertionTest__can_match_a_file_snapshot__1.jpg
- AssertionTest__can_match_a_file_snapshot_with_explicit_id__s-my-file-snapshot.jpg
- MatchesSnapshotTest__it_can_mismatch_a_file_snapshot__1.jpg
- MatchesSnapshotTest__it_can_mismatch_a_file_snapshot_with_a_different_extension__1.jpg
- MatchesSnapshotTest__it_can_update_a_file_snapshot__1.jpg
- MatchesSnapshotTest__it_can_update_a_file_snapshot_with_a_different_extension__1.jpg
- MatchesSnapshotTest__it_cleans_filenames_on_file_snapshot with dataset Empty__1.jpg
- MatchesSnapshotTest__it_deletes_the_persisted_failed_file_before_a_file_snapshot_assertion__1.jpg
- MatchesSnapshotTest__it_persists_the_failed_file_after_mismatching_a_file_snapshot__1.jpg
- AssertionTest__can_do_multiple_snapshot_assertions__1.txt
- AssertionTest__can_do_multiple_snapshot_assertions__2.txt
- AssertionTest__can_match_a_file_hash_snapshot__1.txt
- AssertionTest__can_match_a_file_hash_snapshot_with_explicit_id__s-my-file-hash-snapshot.txt
- AssertionTest__can_match_a_json_snapshot__1.json
- AssertionTest__can_match_a_json_snapshot_with_explicit_id__s-my-json-snapshot.json
- AssertionTest__can_match_a_snapshot_with_explicit_id__s-my-snapshot.txt
- AssertionTest__can_match_a_string_snapshot__1.txt
- AssertionTest__can_match_a_text_snapshot_with_explicit_id__s-my-text-snapshot.txt
- AssertionTest__can_match_a_yaml_snapshot_with_explicit_id__s-my-yaml-snapshot.yml
- AssertionTest__can_match_an_array_snapshot__1.json
- AssertionTest__can_match_an_html_snapshot__1.html
- AssertionTest__can_match_an_html_snapshot_with_explicit_id__s-my-html-snapshot.html
- AssertionTest__can_match_an_object_snapshot_with_explicit_id__s-my-object-snapshot.yml
- AssertionTest__can_match_an_xml_snapshot__1.xml
- AssertionTest__can_match_an_xml_snapshot_with_explicit_id__s-my-xml-snapshot.xml
- AssertionTest__explicit_ids_do_not_affect_auto_increment_ids__1.txt
- AssertionTest__explicit_ids_do_not_affect_auto_increment_ids__2.txt
- AssertionTest__explicit_ids_do_not_affect_auto_increment_ids__3.txt
- AssertionTest__explicit_ids_do_not_affect_auto_increment_ids__s-another-named.txt
- AssertionTest__explicit_ids_do_not_affect_auto_increment_ids__s-named.txt
- AssertionTest__numeric_explicit_ids_do_not_conflict_with_auto_increment_ids__1.txt
- AssertionTest__numeric_explicit_ids_do_not_conflict_with_auto_increment_ids__2.txt
- AssertionTest__numeric_explicit_ids_do_not_conflict_with_auto_increment_ids__s-1.txt
- AssertionTest__numeric_explicit_ids_do_not_conflict_with_auto_increment_ids__s-2.txt
- MatchesSnapshotTest__it_can_match_an_existing_file_hash_snapshot__1.json
- MatchesSnapshotTest__it_can_match_an_existing_html_snapshot__1.html
- MatchesSnapshotTest__it_can_match_an_existing_json_snapshot__1.json
- MatchesSnapshotTest__it_can_match_an_existing_string_snapshot__1.json
- MatchesSnapshotTest__it_can_match_an_existing_xml_snapshot__1.xml
- MatchesSnapshotTest__it_can_mismatch_a_file_hash_snapshot__1.txt
- MatchesSnapshotTest__it_can_mismatch_a_html_snapshot__1.html
- MatchesSnapshotTest__it_can_mismatch_a_json_snapshot__1.json
- MatchesSnapshotTest__it_can_mismatch_a_string_snapshot__1.txt
- MatchesSnapshotTest__it_can_mismatch_a_xml_snapshot__1.xml
- MatchesSnapshotTest__it_can_update_a_html_snapshot__1.html
- MatchesSnapshotTest__it_can_update_a_json_snapshot__1.json
- MatchesSnapshotTest__it_can_update_a_snapshot_with_env_var__1.txt
- MatchesSnapshotTest__it_can_update_a_string_snapshot__1.txt
- MatchesSnapshotTest__it_can_update_a_xml_snapshot__1.xml
- file.jpg
- file.png
- snapshot.html
- snapshot.json
- snapshot.xml
- snapshot.yml
- string_snapshot.txt
- file_without_extension
- friendly_man.jpg
- no_man.png
- troubled_man.jpg
- AssertionTest.php
- ComparesSnapshotFiles.php
- MatchesSnapshotTest.php
- UpdateSnapshotsBinaryTest.php
- HtmlDriverTest.php
- ImageDriverTest.php
- JsonDriverTest.php
- ObjectDriverTest.php
- TextDriverTest.php
- XmlDriverTest.php
- YamlDriverTest.php
- testA.png
- testB.png
- testC.png
- FilenameTest.php
- SnapshotTest.php
- .editorconfig
- .gitattributes
- .gitignore
- CHANGELOG.md
- composer.json
- LICENSE.md
- package.json
- phpunit.xml.dist
- README.md
# Installation Guide
1. Get the code
git clone https://github.com/spatie/phpunit-snapshot-assertions
Downloads the entire project code from GitHub to your computer.
cd phpunit-snapshot-assertions
Moves into the project folder you just downloaded.
2. Node.js
Easy RecommendedPrerequisites
npm install
Downloads and installs the libraries listed in package.json.
npm start
Starts the development/run server.
After running the command, open the address shown in the terminal (usually something like http://localhost:3000) in your browser.
3. PHP (Composer)
EasyPrerequisites
composer require --dev spatie/phpunit-snapshot-assertions
Type this command into your terminal and run it.
Run it with a built-in server like php -S localhost:8000, then open http://localhost:8000 in your browser.
Pulled directly from this repo's README.
// repository documentation
Was this content helpful?
(0 ratings)
