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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
landish
May 29, 2015
Programming
0
110
PHPUnit
landish
May 29, 2015
Tweet
Share
More Decks by landish
See All by landish
Anatomy Of The Web
landish
1
190
Markdown
landish
0
160
Introduction to Ionic Framework
landish
0
100
Some Modern Tools for Developers
landish
0
130
Introduction to GIT
landish
0
69
Other Decks in Programming
See All in Programming
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
2k
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
450
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
PRO
0
190
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.5k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
300
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
170
CSC307 Lecture 11
javiergs
PRO
0
580
AI & Enginnering
codelynx
0
140
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
180
文字コードの話
qnighy
41
15k
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
Featured
See All Featured
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Are puppies a ranking factor?
jonoalderson
1
3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
HDC tutorial
michielstock
1
460
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Odyssey Design
rkendrick25
PRO
2
520
Code Reviewing Like a Champion
maltzj
527
40k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
450
Marketing to machines
jonoalderson
1
5k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
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/>