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
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
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
3
480
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
410
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2k
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
280
Sans tests, vos agents ne sont pas fiables
nabondance
0
130
AgentCore Optimizationを始めよう!
licux
3
240
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
0
100
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
190
空間オーディオの活用
objectiveaudio
0
150
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
106
240k
Believing is Seeing
oripsolob
1
130
Utilizing Notion as your number one productivity tool
mfonobong
4
300
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
170
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3k
Technical Leadership for Architectural Decision Making
baasie
3
360
Un-Boring Meetings
codingconduct
0
290
Exploring anti-patterns in Rails
aemeredith
3
360
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
GitHub's CSS Performance
jonrohan
1033
470k
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