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
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1.1k
監視 やばい
syossan27
11
10k
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
120
Laravel × Clean Architecture
bumptakayuki
PRO
0
120
Cursorを活用したAIプログラミングについて 入門
rect
0
110
複雑なフォームの jotai 設計 / Designing jotai(state) for Complex Forms #layerx_frontend
izumin5210
4
1.3k
GitHub Copilot for Azureを使い倒したい
ymd65536
1
210
KANNA Android の技術的課題と取り組み
watabee
0
140
DevOpsDaysTokyo2025社内副業で他部門へ_越境_して見えた価値再定義最大1か月のリードタイムを10分に短縮したDevOps実践.pdf
susumutomita
0
100
プロフェッショナルとしての成長「問題の深掘り」が導く真のスキルアップ / issue-analysis-and-skill-up
minodriven
8
1.8k
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
350
Make Parsers Compatible Using Automata Learning
makenowjust
2
5.8k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.7k
Embracing the Ebb and Flow
colly
85
4.7k
Rails Girls Zürich Keynote
gr2m
94
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
119
51k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Building Adaptive Systems
keathley
41
2.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.3k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
400
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