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
71
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
520
Docker: multi-stage multi-environment
abdala
0
300
Programação também é mágica
abdala
0
140
Websockets e você, tudo a ver
abdala
1
110
PHP em todos os lugares
abdala
1
110
Automatizado rotinas com sua linguagem favorita
abdala
0
79
Presente! Software Livre
abdala
0
51
Other Decks in Programming
See All in Programming
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.2k
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
200
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
Elm 0.19.0 Changes
bkuhlmann
0
480
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
スクラムチームと認知負荷 - ニフティのスクラムトーク Vol2. / NIFTY Tech Talk #18
niftycorp
PRO
1
120
Site Reliability Engineering for GMO
pyama86
5
680
Folding Cheat Sheet #1
philipschwarz
PRO
0
210
"config" ってなんだ? / What is "config"?
okashoi
0
210
OpenTelemetry のサービスという概念について
azukiazusa1
2
1k
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
3.1k
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
340
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
242
12k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The Brand Is Dead. Long Live the Brand.
mthomps
48
27k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
8
8.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
645
57k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
103
6.6k
Practical Orchestrator
shlominoach
180
9.7k
How To Stay Up To Date on Web Technology
chriscoyier
781
250k
Principles of Awesome APIs and How to Build Them.
keavy
119
16k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
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