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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
710
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
140
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
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
190
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
620
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
3
390
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
190
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
450
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
3
170
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
色即是空、空即是色、データサイエンス
kamoneggi
1
110
Cloudflare で始める Data Platform
ta93abe
0
180
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
1
120
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
370
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
330
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
Navigating Weather and Climate Data
rabernat
0
190
Building an army of robots
kneath
306
46k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
360
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
New Earth Scene 8
popppiees
3
2.2k
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