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
90
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
670
Docker: multi-stage multi-environment
abdala
0
380
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
99
Presente! Software Livre
abdala
0
73
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
400
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
230
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
160
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
Fragmented Architectures
denyspoltorak
0
150
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
950
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
CSC307 Lecture 03
javiergs
PRO
1
490
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
63
WCS-LA-2024
lcolladotor
0
450
AI: The stuff that nobody shows you
jnunemaker
PRO
2
250
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Amusing Abliteration
ianozsvald
0
99
Agile that works and the tools we love
rasmusluckow
331
21k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
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