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
93
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
140
Introduction to Ionic Framework
landish
0
85
Some Modern Tools for Developers
landish
0
120
Introduction to GIT
landish
0
51
Other Decks in Programming
See All in Programming
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
230
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
7
1.4k
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.2k
設計の本質:コード、システム、そして組織へ / The Essence of Design: To Code, Systems, and Organizations
nrslib
10
3.7k
State of Namespace
tagomoris
5
2.4k
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
760
The Implementations of Advanced LR Parser Algorithm
junk0612
2
1.3k
Laravel × Clean Architecture
bumptakayuki
PRO
0
130
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
120
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
230
파급효과: From AI to Android Development
l2hyunwoo
0
160
Browser and UI #2 HTML/ARIA
ken7253
2
170
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
230
18k
Why Our Code Smells
bkeepers
PRO
336
57k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
BBQ
matthewcrist
88
9.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
How GitHub (no longer) Works
holman
314
140k
Code Reviewing Like a Champion
maltzj
523
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
410
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
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/>