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
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
230
ErdMap: Thinking about a map for Rails applications
makicamel
1
700
Azure AI Foundryのご紹介
qt_luigi
1
210
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
AWS re:Invent 2024個人的まとめ
satoshi256kbyte
0
110
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
Alba: Why, How and What's So Interesting
okuramasafumi
0
220
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.3k
Rubyでつくるパケットキャプチャツール
ydah
0
180
Beyond ORM
77web
11
1.6k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
4
180
Become a Pro
speakerdeck
PRO
26
5.1k
Building Adaptive Systems
keathley
38
2.4k
The Invisible Side of Design
smashingmag
299
50k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Done Done
chrislema
182
16k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
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/>