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
98
PHPUnit
landish
May 29, 2015
Tweet
Share
More Decks by landish
See All by landish
Anatomy Of The Web
landish
1
180
Markdown
landish
0
150
Introduction to Ionic Framework
landish
0
90
Some Modern Tools for Developers
landish
0
130
Introduction to GIT
landish
0
54
Other Decks in Programming
See All in Programming
The Flutter Journey of Building a Live Streaming App — With a Side of Performance Tuning
u503
1
100
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
240
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
430
ポスターセッション: 「まっすぐ行って、右!」って言ってラズパイカーを動かしたい 〜生成AI × Raspberry Pi Pico × Gradioの試作メモ〜
komofr
0
1k
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
360
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
240
Six and a half ridiculous things to do with Quarkus
hollycummins
0
130
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
430
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
140
私はどうやって技術力を上げたのか
yusukebe
43
17k
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
380
どの様にAIエージェントと 協業すべきだったのか?
takefumiyoshii
2
620
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Docker and Python
trallard
46
3.6k
Fireside Chat
paigeccino
40
3.7k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Building Applications with DynamoDB
mza
96
6.6k
Bash Introduction
62gerente
615
210k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Statistics for Hackers
jakevdp
799
220k
RailsConf 2023
tenderlove
30
1.2k
Designing for humans not robots
tammielis
254
26k
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/>