Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Snapshot testing (nomadphp)
Search
Freek Van der Herten
July 20, 2017
Technology
0
160
Snapshot testing (nomadphp)
Freek Van der Herten
July 20, 2017
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
40
Uncharted packages (Laravel Live Denmark)
freekmurze
0
240
I shall define this only once
freekmurze
0
450
An Introduction to Snapshot testing
freekmurze
0
530
Event Sourcing In Laravel
freekmurze
0
270
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
840
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
890
A practical look at multitenancy in Laravel
freekmurze
1
380
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
760
Other Decks in Technology
See All in Technology
AIエージェントを5分で一気におさらい!AIエージェント「構築」元年に備えよう
yakumo
1
110
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
280
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
220
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
120
NIKKEI Tech Talk #41: セキュア・バイ・デザインからクラウド管理を考える
sekido
PRO
0
240
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.8k
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
490
ESXi のAIOps だ!2025冬
unnowataru
0
400
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
250
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.8k
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
0
110
Featured
See All Featured
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
50k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.4k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
410
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
150
A Modern Web Designer's Workflow
chriscoyier
698
190k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
23
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
300
The SEO identity crisis: Don't let AI make you average
varn
0
39
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Transcript
A practical intro to snapshot testing
About me Freek Van der Herten Partner & developer at
SPATIE @freekmurze https://murze.be
About me phpantwerp.be Dries Vints @driesvints Frederick Vanbrabant @TheEdonian
Since 2003 Websites, applications and webshops Team 4 developers, 1
manager Specialization Laravel development
OPEN SOURCE SOFTWARE
± 120 packages on Packagist Laravel, Framework agnostic PHP ±
4 000 000 downloads in total, growing ±500 000 a month We create a lot of it Open source software
http://github-awards.com/users?type=world&language=php Open source software
LET’S TALK SNAPSHOT TESTING
A file on disk, let’s call in snapshot Test succeeds
if output matches snapshot If not, test will fail What?
Old name: characterization testing Popularized by Facebook Jest Testing interfaces
Where does it come from?
https://github.com/spatie/phpunit-snapshot-assertions assertMatchesSnapshot assertMatchesJsonSnapshot assertMatchesXmlSnapshot How can we do it in
PHP?
DEMO
WRAPPING UP
Advantages Very easy to get started with Can be used
to validate complex output Easily update all the tests in one go
Disadvantages Brittle Hard to pinpoint exact point of failure Bugs
can be easily written in the snapshots
https://github.com/spatie/phpunit-snapshot-assertions https://sebastiandedeyne.com/posts/2017/a-package-for-snapshot- testing-in-phpunit https://murze.be/2017/04/practical-introduction-snapshot-testing/ https://www.sitepoint.com/snapshot-testing-viable-php/ https://facebook.github.io/jest/docs/snapshot-testing.html Interesting links
Thank you! https://speakerdeck.com/freekmurze/snapshot-testing-nomadphp https://spatie.be/opensource https://murze.be https://murze.be/newsletter/
QUESTIONS?