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
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
730
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
150
Automatizado rotinas com sua linguagem favorita
abdala
0
110
Presente! Software Livre
abdala
0
82
Other Decks in Programming
See All in Programming
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
7.9k
業務時間外もAIに働いてもらう話
colorful12
2
8.9k
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
120
ALB ログから Trace を気合で繋げる技術
fohte
7
770
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.2k
仕様駆動開発の消費期限
watany
20
9.1k
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
160
不幸な GC
chencmd
0
820
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
430
高専キャリア LT 発表内容
crysta1221
5
4.7k
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
240
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
210
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
A better future with KSS
kneath
240
18k
Believing is Seeing
oripsolob
1
200
Testing 201, or: Great Expectations
jmmastey
46
8.3k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Optimizing for Happiness
mojombo
378
71k
Building AI with AI
inesmontani
PRO
1
1.2k
Are puppies a ranking factor?
jonoalderson
2
3.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.4k
First, design no harm
axbom
PRO
2
1.3k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
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