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
Laravel Integration Testing
Search
Fareez Ahamed
January 31, 2016
Programming
3
130
Laravel Integration Testing
Slides of Laravel Integration Testing talk at Laravel Chennai Meetup #3
Fareez Ahamed
January 31, 2016
Tweet
Share
More Decks by Fareez Ahamed
See All by Fareez Ahamed
Access Control in Laravel
fareez
4
260
Other Decks in Programming
See All in Programming
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
Grafana Cloudとソラカメ
devoc
0
170
チームリードになって変わったこと
isaka1022
0
200
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
680
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
260
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
560
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
46
17k
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
2024年のWebフロントエンドのふりかえりと2025年
sakito
2
240
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
890
Featured
See All Featured
A Tale of Four Properties
chriscoyier
158
23k
A Philosophy of Restraint
colly
203
16k
The Cult of Friendly URLs
andyhume
78
6.2k
Designing for humans not robots
tammielis
250
25k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Embracing the Ebb and Flow
colly
84
4.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Transcript
Laravel Integration Testing
I’m Fareez Ahamed
SSE @ Mphasis
Why Integration Testing?
Behat & Codeception PHP’s Solutions
What Laravel has in bag?
class ExampleTest extends TestCase { /** * A basic functional
test example. * @return void */ public function testBasicExample() { $this->visit('/') ->see('Laravel 5') ->dontSee('Rails'); } }
a very clean testing API
a very clean testing API based on PHPUnit
What it’s NOT?
Not a complete test framework
Not a complete test framework Doesn’t run a headless browser
Not a complete test framework Doesn’t run a headless browser
Doesn’t test on real browser
Not a complete test framework Doesn’t run a headless browser
Doesn’t test on real browser Doesn’t test Javascript
Testing Application
public function testPhotoCanBeUploaded() { $this->visit('/upload') ->type('File Name', 'name') ->attach($absolutePathToFile, 'photo')
->press('Upload') ->see('Upload Successful!'); }
Testing JSON API
public function test_create_quotation_with_new_btn() { $id = '897564'; $this->post('/api/v1/quotation',['id' => $id])
->seeJson([ "message" => 'Successfully Created' ]) ->seeInDatabase('quotations',['id' => $id]); }
Migrations and Middlewares
Some useful config
Thanks!!!
fareez_ahamed
[email protected]
www.fareez.info