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
48
Other Decks in Programming
See All in Programming
『品質』という言葉が嫌いな理由
korimu
0
160
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
180
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
540
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
330
SwiftUI Viewの責務分離
elmetal
PRO
2
240
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
320
仕様変更に耐えるための"今の"DRY原則を考える / Rethinking the "Don't repeat yourself" for resilience to specification changes
mkmk884
5
870
ML.NETで始める機械学習
ymd65536
0
120
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
650
color-scheme: light dark; を完全に理解する
uhyo
5
410
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Writing Fast Ruby
sferik
628
61k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
Rails Girls Zürich Keynote
gr2m
94
13k
Six Lessons from altMBA
skipperchong
27
3.6k
Docker and Python
trallard
44
3.3k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Building Adaptive Systems
keathley
40
2.4k
Optimising Largest Contentful Paint
csswizardry
34
3.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/>