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
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
Feature Toggle は捨てやすく使おう
gennei
0
400
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
120
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
920
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.3k
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
1
290
存在論的プログラミング: 時間と存在を記述する
koriym
5
760
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.3k
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
440
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.3k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.4k
Being A Developer After 40
akosma
91
590k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
240
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
Are puppies a ranking factor?
jonoalderson
1
3.2k
Typedesign – Prime Four
hannesfritz
42
3k
How STYLIGHT went responsive
nonsquared
100
6k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
99
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
420
Context Engineering - Making Every Token Count
addyosmani
9
790
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