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
PHPUnit
Search
landish
May 29, 2015
Programming
0
91
PHPUnit
landish
May 29, 2015
Tweet
Share
More Decks by landish
See All by landish
Anatomy Of The Web
landish
1
170
Markdown
landish
0
130
Introduction to Ionic Framework
landish
0
83
Some Modern Tools for Developers
landish
0
120
Introduction to GIT
landish
0
47
Other Decks in Programming
See All in Programming
fs2-io を試してたらバグを見つけて直した話
chencmd
0
240
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
290
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
280
Go の GC の不得意な部分を克服したい
taiyow
3
800
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
560
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
100
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
330
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
880
103 Early Hints
sugi_0000
1
250
Recoilを剥がしている話
kirik
5
6.9k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building an army of robots
kneath
302
44k
Transcript
Unit Testing With PHPUnit https://phpunit.de/
Test, that the code you wrote, actually works. Concept
Why? • Code Quality • Changes Does Not Break Anything
• Easy Contribution • Speed Up Development • Continuous Integration • Sleep At Night
Testing In Browser
Installation Old Way New (Modern) Way https://phpunit.de/manual/current/en/installation.html
Configuration - phpunit.xml(.dist) https://phpunit.de/manual/current/en/appendixes.configuration.html
File Structure |--src/ |----Example.php |--tests/ |----ExampleTest.php |--phpunit.xml
Example Test Case <?php class ExampleTest extends PHPUnit_Framework_TestCase { //
… public function testExample() { // … } // … }
https://phpunit.de/manual/current/en/appendixes.assertions.html Assertions
https://phpunit.de/manual/current/en/appendixes.annotations.html @Annotations
Test CLI
PHPUnit with PHPStorm
https://github.com/Landish/Pagination Showcase
<Live Code/>