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
84
PHPUnit
landish
May 29, 2015
Tweet
Share
More Decks by landish
See All by landish
Anatomy Of The Web
landish
1
160
Markdown
landish
0
120
Introduction to Ionic Framework
landish
0
80
Some Modern Tools for Developers
landish
0
95
Introduction to GIT
landish
0
43
Other Decks in Programming
See All in Programming
WasmOS: Wasmを実行する自作Microkernel
riru
0
370
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
1.3k
MySQL のインデックスの種類をおさらいしよう! / overviewing indexes in MySQL
okashoi
0
170
IntelliJ IDEA を知らなかった 自分に教えたい小ネタ集 / IntelliJ IDEA Hints for My Past Self
mackey0225
3
160
プロンプトエンジニアリング入門
tomokusaba
2
970
incrementalモデルの理解を深める
ikkimiyazaki
2
640
「コンパイル時のユニットテスト」導入するとユニットテストを 書かなくてよくなるのか?
tomohisa
9
2.1k
CSRF対策のやり方、そろそろアップデートしませんか / Update your knowledge of CSRF protection
hiro_y
25
14k
ここ1~2年くらいで 使えるようになった(主要ブラウザーの最新版 がすべて対応した ) ウェブの新機能について ランダムに喋る!
myzkyy
9
6.4k
フロントエンドパフォーマンス 入門
shouta2
7
1.5k
Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift
omochi
2
510
Laravel OpenAPIによる"辛くない"スキーマ駆動開発
kentaroutakeda
2
2.1k
Featured
See All Featured
Teambox: Starting and Learning
jrom
126
8.4k
How to train your dragon (web standard)
notwaldorf
71
5.1k
Optimizing for Happiness
mojombo
369
69k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Become a Pro
speakerdeck
PRO
8
4.4k
Gamification - CAS2011
davidbonilla
76
4.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
KATA
mclloyd
14
11k
Raft: Consensus for Rubyists
vanstee
130
6.2k
What's in a price? How to price your products and services
michaelherold
236
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
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/>