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
Approachable Testing with PHPUnit and Laravel
Search
Nathan Morgan
February 15, 2018
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Approachable Testing with PHPUnit and Laravel
GIFS + Resource Links
Nathan Morgan
February 15, 2018
Other Decks in Programming
See All in Programming
霧の中の代数的エフェクト
funnyycat
1
370
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.2k
えっ!!コードを読まずに開発を!?
hananouchi
0
200
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
210
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
210
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
3
370
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
500
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
5.9k
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
700
どこまでゆるくて許されるのか
tk3fftk
0
480
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
210
Claude Team Plan導入・ガイド
tk3fftk
0
190
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The Cult of Friendly URLs
andyhume
79
6.9k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Git: the NoSQL Database
bkeepers
PRO
432
67k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
360
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Visualization
eitanlees
152
17k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
The browser strikes back
jonoalderson
0
1.4k
So, you think you're a good person
axbom
PRO
2
2.1k
Transcript
Approachable Testing with PHPUnit and Laravel 1
What would make tests unapproachable? 2
What would make tests approachable? 4 Fun to write 4
Easy to write 4 Easy to maintain 4 Fast 4 Provide confidence 4 Allow for refactorability 3
What we'll be using? 4 PHPUnit 4 Laravel 5.5 4
Atom PHPUnit Package 4
Getting Setup for Testing 5
6
7
8
9
10
phpunit --group integration 11
12
13
Productivity Tips 14
Aliases 15
16
Snippets + Shortcuts 17
GIF: Snippets + Shortcuts 18
PHPUnit Package 19
GIF: PHPUnit Package: Failing Test 20
GIF: PHPUnit Package: Passing Test 21
PHPUnit Package 4 Atom 4 https://github.com/fuelingtheweb/atom-phpunit/ tree/develop 4 https://github.com/Synapse791/atom-phpunit 22
PHPUnit Package 4 Sublime Text 4 https://github.com/adamwathan/sublime-phpunit 4 PhpStorm 4
https://laravel-news.com/phpunit-phpstorm 23
Feature Test Workflow Borrowing a Book 24
art make:test BorrowingBooksTest 25
26
27
28
29
30
31
32
33
art make:model Book -m 34
art make:factory BookFactory -m Book 35
36
37
38
39
art make:controller LoansController -r 40
41
42
43
art make:model Loan -m 44
45
46
47
48
49
50
51
Unit Test Workflow Creating a Loan 52
53
$user->borrow($book); 54
$book->borrowBy($user); $book->loanTo($user); 55
Loan::fromBook($book)->to($user); 56
art make:test --unit LoanTest 57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Other Resources 4 Laracasts Testing Tutorials 4 Let's Build A
Forum with Laravel and TDD 4 Testing Laravel 4 $15/month for full access or $350 one time 78
Other Resources 4 Test Driven Laravel: Video Course by Adam
Wathan 4 $149 sale price until Feb. 16 ($100 off) 4 Rails Conf 2013 The Magic Tricks of Testing by Sandi Metz 79