Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JLPDevs - Web Application Unit Testing: Strateg...
Search
JLP Community
December 05, 2015
Programming
0
47
JLPDevs - Web Application Unit Testing: Strategy and Tools
JLP Community
December 05, 2015
Tweet
Share
More Decks by JLP Community
See All by JLP Community
JLP Community Profile
jlpcommunity
0
56
JLPDevs - Optimization Tooling for Modern Web App Development
jlpcommunity
3
210
Other Decks in Programming
See All in Programming
LT資料
t3tra
6
940
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
450
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
260
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
150
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
270
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
400
Graviton と Nitro と私
maroon1st
0
110
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
740
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
380
Microservices rules: What good looks like
cer
PRO
0
1.5k
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
120
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Tell your own story through comics
letsgokoyo
0
740
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Odyssey Design
rkendrick25
PRO
0
420
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Faster Mobile Websites
deanohume
310
31k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Invisible Side of Design
smashingmag
302
51k
For a Future-Friendly Web
brad_frost
180
10k
Music & Morning Musume
bryan
46
7k
Technical Leadership for Architectural Decision Making
baasie
0
180
Transcript
Web Application Unit Testing: Strategy and Tools Presented by: Salman
El Farisi 05 Desember 2015 @ code margonda
Let's Move On Runnable Code Testable Code
Not So Testable Code
Better Version
Better Version (2)
Testing Pyramid
Web Application Unit Testing Challenge: Too much dependency Network
(HTTP Request) Database Third Party Library File System (upload / download file) Tools: PHPUnit (Unit testing framework) Mockery (Mock Object) Faker (Fake Object) PHP-DI / Pimple (Dependency Injection Library)
Mockery
Faker
Web Application Unit Testing (2)
Web Application Unit Testing (3)
Web Application Unit Testing (3) Assertion: Compare expected and actual
value AssertTrue() AssertNotNull() AssertEquals() AssertArrayHasKey() AssertClassHasAttribute() Etc. https://phpunit.de/manual/current/en/phpunit-book.html#appendixes.assertions
Mock Object RoleController.php Connect to database
Mock Object (2) RoleControllerTest.php Control the 'Role' class behaviour so
it wont touch the database
Fake Object Create fake object
Thank You :)