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
93
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
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
780
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
800
Ruby and LLM Ecosystem 2nd
koic
0
380
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
980
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
350
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
260
Windows on Ryzen and I
seosoft
0
230
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
370
文字コードの話
qnighy
44
17k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.8k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
190
Amusing Abliteration
ianozsvald
0
130
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
300
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
82
The World Runs on Bad Software
bkeepers
PRO
72
12k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
210
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