Primärer Hyperparathyreoidismus (pHPT) Diagnostik und Lokalisationsdiagnostik
PHPT
-
Upload
ivan-rosolen-phpsp -
Category
Technology
-
view
2.318 -
download
3
description
Transcript of PHPT
![Page 1: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/1.jpg)
PHPTPHPMS Conf 2012
![Page 2: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/2.jpg)
IVAN ROSOLEN@ivanrosolen
http://about.me/ivanrosolen
Co-fundador do PHPSP
Equipe de inovação da ARIZONADesenvolvedor 10+ anos
![Page 3: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/3.jpg)
PHPT• Apenas um teste por aquivo .phpt
• Testes executados em processos separados
• Diferentes configurações do PHP para cada teste
![Page 4: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/4.jpg)
• Bugs - bug<id>.phpt
• Funções Comportamento básico - <nomedafuncao>_basic.phpt Erro - <nomedafuncao>_error.phpt Variações - <nomedafuncao>_variation.phpt
• Extensões - <nomedaextensao><numero>.phpt
Nomenclatura
![Page 5: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/5.jpg)
--TEST-- Uma linha para descrever o teste
--FILE-- código PHP (isso mesmo PHP!)
--EXPECT--Resultado esperado (acerto ou erro)
Seções Obrigatórias
![Page 6: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/6.jpg)
--TEST-- [--DESCRIPTION--]
[--CREDITS--] [--SKIPIF--]
[--REQUEST--] [--POST-- | --PUT-- | --POST_RAW-- | --GZIP_POST-- | --DEFLATE_POST-- | --GET--]
[--COOKIE--] [--STDIN--]
[--INI--] [--ARGS--] [--ENV--]
--FILE-- | --FILEEOF-- | --FILE_EXTERNAL-- | --REDIRECTTEST-- [--HEADERS--]
[--CGI--] [--XFAIL--]
[--EXPECTHEADERS--]--EXPECT-- | --EXPECTF-- | --EXPECTREGEX--
[--CLEAN--]
![Page 7: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/7.jpg)
--EXPECTF--%s string
%d number
%c single char
%w whitespace
%i integer
%f floats
%x hexadecimal
%e directory sep.
![Page 8: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/8.jpg)
Baixar o source da versão do PHP desejada
./configure (com parâmetros necessários)make
Como Fazer
make test
tar -xvf php-5.4.5.tar.gz
![Page 9: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/9.jpg)
make test TESTS=diretorio/
Testando
make test TESTS=diretorio/*.phpt
make test TESTS=diretorio/nome.phpt
Teoricamente .zip do PHP win roda os testes com o php.exenmake test
![Page 10: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/10.jpg)
Exemplos
![Page 11: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/11.jpg)
--TEST--Xuplau--FILE--<?php echo 'Xuplau’; ?>--EXPECT--Xuplau
![Page 12: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/12.jpg)
--TEST--Xuplau Error--FILE--<?php echo 'Xuplau--EXPECTF--Parse error: syntax error, unexpected '%s' (T_ENCAPSED_AND_WHITESPACE) in %s.php on line %d
![Page 13: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/13.jpg)
--TEST--Xuplau Error--FILE--<?php echo 'Xuplau--EXPECTREGEX--Parse error: (syntax|parse) error, unexpected .* \(T_ENCAPSED_AND_WHITESPACE\) in .* on line \d
![Page 14: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/14.jpg)
--TEST--Apagar TMP Files--FILE--<?php$tmp = dirname(__FILE__) . '/foo.tmp';$fp = fopen($tmp, 'w');fwrite($fp, 'bar');fclose($fp);?>--CLEAN--<?php$tmp = dirname(__FILE__) . '/foo.tmp';unlink($tmp)?>--EXPECT--
![Page 15: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/15.jpg)
--TEST--Skipif teste!--SKIPIF--<?phpif ( substr(PHP_OS, 0, 3 ) != 'WIN') die('Teste apenas para Unix');?>--FILE----EXPECT--
![Page 16: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/16.jpg)
--TEST-- Testing imagerectangle() of GD library --CREDITS-- Ivan Rosolen <contato [at] ivanrosolen [dot] com> #testfest PHPSP on 2009-06-30--SKIPIF-- <?php if ( ! extension_loaded('gd') ) die( 'skip GD not present; skipping test' ); ?> --FILE--<?php// Create a image $image = imagecreatetruecolor( 100, 100 );
// Draw a rectangleimagerectangle( $image, 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) );
ob_start(); imagepng( $image, null, 9 ); $img = ob_get_contents(); ob_end_clean();
echo md5(base64_encode($img));
?> --EXPECT-- 282aaecfdd50091821d63093d9bb1bb9
![Page 17: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/17.jpg)
--TEST--Testing wrong param passing imagefilledellipse() of GD library--CREDITS--Ivan Rosolen <contato [at] ivanrosolen [dot] com>#phpsptestfest PHPSP on 2010-05-29--SKIPIF--<?php if (!extension_loaded("gd")) die("skip GD not present");?>--FILE--<?php
// Create a image$image = imagecreatetruecolor(400, 300);
// choose a color for the ellipse$ellipse = imagecolorallocate($image, 255, 255, 255);
// draw the white ellipseimagefilledellipse( 'wrong param', 200, 150, 300, 200, $ellipse);
?>--EXPECTF--Warning: imagefilledellipse() expects parameter 1 to be resource, %s given in %s on line %d
![Page 18: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/18.jpg)
*.exp
*.log
*.out
*.php
*.phpt
*.sh
Deu erro!
*.diff
![Page 20: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/20.jpg)
PHPT +• Suas extensões
• Seus Projetos
https://github.com/vrana/notorm
![Page 21: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/21.jpg)
• Clonar git https://github.com/php/php-src
• Pull Request
• Avisar na lista do QA
Quality Assurance list - [email protected]
Enviando Testes
![Page 22: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/22.jpg)
http://gcov.php.net
http://qa.php.net/write-test.php
Links
https://wiki.php.net/qa/testfest-2010/windows-test-environment
Para Windows ( não testei muito ainda )
http://pastebin.com/PPBr05kQ
http://pastebin.com/CxFtXUwS
http://php.net/mailing-lists.php
![Page 23: PHPT](https://reader031.fdocuments.net/reader031/viewer/2022020116/55946e2a1a28abe5718b4625/html5/thumbnails/23.jpg)
Dúvidas?