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
0
280
Approachable Testing with PHPUnit and Laravel
GIFS + Resource Links
Nathan Morgan
February 15, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
Go言語はstack overflowの夢を見るか?
logica0419
0
470
CSC305 Lecture 08
javiergs
PRO
0
250
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
2.2k
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
120
What's new in Spring Modulith?
olivergierke
1
160
Devoxx BE - Local Development in the AI Era
kdubois
0
130
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
600
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
220
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
130
Swift Concurrency - 状態監視の罠
objectiveaudio
2
550
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.1k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
550
Featured
See All Featured
Music & Morning Musume
bryan
46
6.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Balancing Empowerment & Direction
lara
5
690
Agile that works and the tools we love
rasmusluckow
331
21k
Speed Design
sergeychernyshev
32
1.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Designing Experiences People Love
moore
142
24k
Being A Developer After 40
akosma
91
590k
Embracing the Ebb and Flow
colly
88
4.9k
A designer walks into a library…
pauljervisheath
209
24k
Designing for humans not robots
tammielis
254
26k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
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