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
PHPUnit, ele irá te salvar!
Search
Abdala Cerqueira
April 26, 2012
Programming
0
75
PHPUnit, ele irá te salvar!
Palestra realizado no FLISOL de Patos-PB
Abdala Cerqueira
April 26, 2012
Tweet
Share
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
4
600
Docker: multi-stage multi-environment
abdala
0
350
Programação também é mágica
abdala
0
140
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
120
Automatizado rotinas com sua linguagem favorita
abdala
0
90
Presente! Software Livre
abdala
0
59
Other Decks in Programming
See All in Programming
時計仕掛けのCompose
mkeeda
1
300
Open source software: how to live long and go far
gaelvaroquaux
0
640
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
130
Lottieアニメーションをカスタマイズしてみた
tahia910
0
130
CI改善もDatadogとともに
taumu
0
120
Introduction to kotlinx.rpc
arawn
0
700
SwiftUI Viewの責務分離
elmetal
PRO
1
240
Grafana Cloudとソラカメ
devoc
0
170
Rails アプリ地図考 Flush Cut
makicamel
1
120
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
12
4.1k
Honoとフロントエンドの 型安全性について
yodaka
7
1.3k
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
740
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
How GitHub (no longer) Works
holman
314
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
330
Into the Great Unknown - MozCon
thekraken
35
1.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
450
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
The Language of Interfaces
destraynor
156
24k
The Cult of Friendly URLs
andyhume
78
6.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
PHPUNIT Ele irá te salvar
ABDALA CERQUEIRA • Programador • Patinador • Pai
AGENDA • Níveis de teste • PHPUnit • Exemplos
NÍVEIS DE TESTE • Teste de unidade • Teste de
integração • Teste de sistema
TESTE DE UNIDADE • Verifica se o comportamento é o
esperado • Testa pequenas partes de código isoladas das suas dependências • Não acessa recursos externos (filesystem, banco etc.) • Pode ser criado em qualquer etapa • Não interfere no seu código-fonte
PHPUNIT • Portado do JUnit por Sebastian Bergmann • Instalação
feita via PEAR pear config-set auto_discover 1 pear install pear.phpunit.de/PHPUnit • Não se limita a testes unitários DbUnit, Selenium, Story etc.
PHPUNIT • Várias afirmações(asserts) pré-definidas http://www.phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions • Dependência entre testes
@depends • Provedores de dados @dataProvider • Teste de exceções @expectedException • Imitação de objetos (Stub e Mock)
PHPUNIT • Documentação ágil --testdox • Cobertura de código --coverage-html
EXEMPLOS Vamos testar?
FIM • Site: • E-mail: • Twitter: • Github !
! http://abda.la
[email protected]
@abdalac http://github.com/abdala