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
290
Approachable Testing with PHPUnit and Laravel
GIFS + Resource Links
Nathan Morgan
February 15, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
CSC305 Lecture 13
javiergs
PRO
0
370
業務でAIを使いたい話
hnw
0
240
Dive into Triton Internals
appleparan
0
450
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
340
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
120
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
240
AI駆動開発カンファレンスAutumn2025 _AI駆動開発にはAI駆動品質保証
autifyhq
0
130
CSC509 Lecture 08
javiergs
PRO
0
280
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
280
coconala_slide_pop.pdf
yukihito13
0
230
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
2
820
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
What's in a price? How to price your products and services
michaelherold
246
12k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
A designer walks into a library…
pauljervisheath
210
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Navigating Team Friction
lara
190
15k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
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