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
96
0
Share
PHPUnit, ele irá te salvar!
Palestra realizado no FLISOL de Patos-PB
Abdala Cerqueira
April 26, 2012
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
170
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
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
3
1k
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.6k
Road to RubyKaigi: Play Hard(ware)
makicamel
1
420
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.4k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
180
Angular Signal Forms
debug_mode
0
120
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
170
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
第3木曜LT会 #28
tinykitten
PRO
0
110
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
[RubyKaigi 2026] Require Hooks
palkan
1
220
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
180
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
Abbi's Birthday
coloredviolet
2
7.2k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
Rails Girls Zürich Keynote
gr2m
96
14k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
120
Exploring anti-patterns in Rails
aemeredith
3
320
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
200
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
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