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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nathan Morgan
February 15, 2018
Programming
300
0
Share
Approachable Testing with PHPUnit and Laravel
GIFS + Resource Links
Nathan Morgan
February 15, 2018
Other Decks in Programming
See All in Programming
感情を設計する
ichimichi
5
1.5k
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
470
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
130
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
520
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
2
180
t *testing.T は どこからやってくるの?
otakakot
1
660
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
140
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
350
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
370
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
580
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
5k
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
3
320
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
170
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
290
Done Done
chrislema
186
16k
Odyssey Design
rkendrick25
PRO
2
580
Chasing Engaging Ingredients in Design
codingconduct
0
170
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
Writing Fast Ruby
sferik
630
63k
Ruling the World: When Life Gets Gamed
codingconduct
0
210
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
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