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
90
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
120
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
ヤプリ新卒SREの オンボーディング
masaki12
0
130
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
受け取る人から提供する人になるということ
little_rubyist
0
250
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
Contemporary Test Cases
maaretp
0
140
Realtime API 入門
riofujimon
0
150
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
970
最新TCAキャッチアップ
0si43
0
190
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Statistics for Hackers
jakevdp
796
220k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Ruby is Unlike a Banana
tanoku
97
11k
Building Your Own Lightsaber
phodgson
103
6.1k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Embracing the Ebb and Flow
colly
84
4.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Practical Orchestrator
shlominoach
186
10k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
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/>