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
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
210
MySQL9でベクトルカラム登場!PHP×AWSでのAI/類似検索はこう変わる
suguruooki
1
190
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
7.6k
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
540
Python型ヒント完全ガイド 初心者でも分かる、現代的で実践的な使い方
mickey_kubo
1
250
マッチングアプリにおけるフリックUIで苦労したこと
yuheiito
0
230
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
180
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
12
7.3k
Yes, You Can Work on Rails & any other Gem
kaspth
0
110
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
190
ソフトウェア設計とAI技術の活用
masuda220
PRO
23
6.3k
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
270
Featured
See All Featured
Docker and Python
trallard
45
3.5k
Producing Creativity
orderedlist
PRO
346
40k
Building Applications with DynamoDB
mza
95
6.5k
We Have a Design System, Now What?
morganepeng
53
7.7k
Typedesign – Prime Four
hannesfritz
42
2.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1k
How to Ace a Technical Interview
jacobian
278
23k
The Pragmatic Product Professional
lauravandoore
35
6.8k
Designing Experiences People Love
moore
142
24k
Speed Design
sergeychernyshev
32
1k
Code Review Best Practice
trishagee
69
19k
Automating Front-end Workflow
addyosmani
1370
200k
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