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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPUnit
landish
May 29, 2015
More Decks by landish
See All by landish
Anatomy Of The Web
landish
1
200
Markdown
landish
0
170
Introduction to Ionic Framework
landish
0
110
Some Modern Tools for Developers
landish
0
140
Introduction to GIT
landish
0
78
Other Decks in Programming
See All in Programming
The NotImplementedError Problem in Ruby
koic
1
740
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Contextとはなにか
chiroruxx
1
310
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
230
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
890
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3.7k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
570
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
740
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
540
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
2k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
510
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.5k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
sira's awesome portfolio website redesign presentation
elsirapls
0
280
New Earth Scene 8
popppiees
3
2.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Paper Plane (Part 1)
katiecoart
PRO
0
8.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Leo the Paperboy
mayatellez
7
1.8k
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/>