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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Abdala Cerqueira
April 26, 2012
Programming
0
94
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
3
700
Docker: multi-stage multi-environment
abdala
0
390
Programação também é mágica
abdala
0
160
Websockets e você, tudo a ver
abdala
1
130
PHP em todos os lugares
abdala
1
140
Automatizado rotinas com sua linguagem favorita
abdala
0
100
Presente! Software Livre
abdala
0
77
Other Decks in Programming
See All in Programming
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
OTP を自動で入力する裏技
megabitsenmzq
0
120
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
条件判定に名前、つけてますか? #phperkaigi #c
77web
1
370
CSC307 Lecture 15
javiergs
PRO
0
260
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
AHC061解説
shun_pi
0
400
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
180
Claude Code Skill入門
mayahoney
0
400
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
400
Windows on Ryzen and I
seosoft
0
330
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
Featured
See All Featured
Leo the Paperboy
mayatellez
4
1.5k
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Everyday Curiosity
cassininazir
0
170
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
Between Models and Reality
mayunak
2
240
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Statistics for Hackers
jakevdp
799
230k
Fireside Chat
paigeccino
42
3.8k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
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