diff --git a/docs/09-Data.md b/docs/09-Data.md index 26cd9514a..aa2e79203 100644 --- a/docs/09-Data.md +++ b/docs/09-Data.md @@ -366,7 +366,26 @@ On next execution the obtained data will be compared with previously saved snaps > To update a snapshot with a new data run tests in `--debug` mode. By default Snapshot uses `assertEquals` assertion, however this can be customized by overriding `assertData` method. + +### Failed assertion output + +The assertion performed by `assertData` will not display the typical diff output from `assertEquals` or any customized failed assertion. +To have the diff displayed when running tests, you can call the snapshot method `shouldShowDiffOnFail`: + +{% highlight php %} + +amOnPage('/categories'); + // I want to see the diff in case the snapshot data changes + $snapshot->shouldShowDiffOnFail(); + $snapshot->assert(); +} + +{% endhighlight %} +If ever needed, the diff output can also be omitted by calling `shouldShowDiffOnFail(false)`. ## Conclusion @@ -378,4 +397,4 @@ to operate with database through a data abstraction layer, and use the DataFacto * **Next Chapter: [APITesting >](/docs/10-APITesting)** -* **Previous Chapter: [< Customization](/docs/08-Customization)** \ No newline at end of file +* **Previous Chapter: [< Customization](/docs/08-Customization)** pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy