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
80
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
4
630
Docker: multi-stage multi-environment
abdala
0
370
Programação também é mágica
abdala
0
160
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
130
Automatizado rotinas com sua linguagem favorita
abdala
0
93
Presente! Software Livre
abdala
0
68
Other Decks in Programming
See All in Programming
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
770
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
15
6.4k
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
250
ふつうの技術スタックでアート作品を作ってみる
akira888
1
880
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
190
AIともっと楽するE2Eテスト
myohei
7
2.7k
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
2
13k
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
230
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
230
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
10
5.4k
RailsGirls IZUMO スポンサーLT
16bitidol
0
190
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Faster Mobile Websites
deanohume
307
31k
The Language of Interfaces
destraynor
158
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
How to train your dragon (web standard)
notwaldorf
95
6.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
The Pragmatic Product Professional
lauravandoore
35
6.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
YesSQL, Process and Tooling at Scale
rocio
173
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