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
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
3.7k
Оптимизируем производительность блока Казначейство
lamodatech
0
990
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
130
Linux && Docker 研修/Linux && Docker training
forrep
22
4.1k
AWS Lambda functions with C# 用の Dev Container Template を作ってみた件
mappie_kochi
0
220
Spring gRPC について / About Spring gRPC
mackey0225
0
180
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.2k
Vue.jsでiOSアプリを作る方法
hal_spidernight
0
120
ErdMap: Thinking about a map for Rails applications
makicamel
1
1.1k
Immutable ActiveRecord
megane42
0
120
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
0
230
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
460
33k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
How to Ace a Technical Interview
jacobian
276
23k
Being A Developer After 40
akosma
89
590k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Designing for Performance
lara
604
68k
Embracing the Ebb and Flow
colly
84
4.5k
Optimising Largest Contentful Paint
csswizardry
33
3k
Become a Pro
speakerdeck
PRO
26
5.1k
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