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 (laraconus)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Freek Van der Herten
July 25, 2017
Programming
0
130
snapshot testing (laraconus)
Freek Van der Herten
July 25, 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
54
Uncharted packages (Laravel Live Denmark)
freekmurze
0
250
I shall define this only once
freekmurze
0
460
An Introduction to Snapshot testing
freekmurze
0
540
Event Sourcing In Laravel
freekmurze
0
280
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
850
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
900
A practical look at multitenancy in Laravel
freekmurze
1
390
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
770
Other Decks in Programming
See All in Programming
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
220
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
500
Event Storming
hschwentner
3
1.3k
ぼくの開発環境2026
yuzneri
1
290
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
190
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
2
180
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3k
あなたはユーザーではない #PdENight
kajitack
4
290
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.4k
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.4k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
5
2.1k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Invisible Side of Design
smashingmag
302
51k
For a Future-Friendly Web
brad_frost
183
10k
30 Presentation Tips
portentint
PRO
1
250
Abbi's Birthday
coloredviolet
2
5k
Visualization
eitanlees
150
17k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
We Are The Robots
honzajavorek
0
190
Technical Leadership for Architectural Decision Making
baasie
3
270
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
200
Fireside Chat
paigeccino
41
3.8k
Transcript
A practical intro to snapshot testing
Pronouncing Dutch Michael 3/10 Jacob 1/10
Pronouncing Dutch Michael 9/10 Jacob 9/10
Drake
Frake
Pronouncing Dutch: Spatie Spa Sea
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-laraconus https://spatie.be/opensource https://murze.be https://murze.be/newsletter/
QUESTIONS?