cvs: pear-core /tests/PEAR_RunTest .cvsignore setup.php.inc teardown.php.inc test_bug9971.phpt
| From: | Greg Beaver | Date: | Wed, 14 Feb 2007 06:09:17 +0000 |
| Subject: | cvs: pear-core /tests/PEAR_RunTest .cvsignore setup.php.inc teardown.php.inc test_bug9971.phpt | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-5417@lists.php.net to get a copy of this message | ||
cellog Wed Feb 14 06:09:17 2007 UTC
Added files:
/pear-core/tests/PEAR_RunTest .cvsignore setup.php.inc
teardown.php.inc test_bug9971.phpt
Log:
add new test for run-tests EXPECTF diffs
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_RunTest/.cvsignore?view=markup&rev=1.1
Index: pear-core/tests/PEAR_RunTest/.cvsignore
+++ pear-core/tests/PEAR_RunTest/.cvsignore
*.diff
*.exp
*.log
*.out
*.php
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_RunTest/setup.php.inc?view=markup&rev=1.1
Index: pear-core/tests/PEAR_RunTest/setup.php.inc
+++ pear-core/tests/PEAR_RunTest/setup.php.inc
<?php
require_once 'PEAR/RunTest.php';
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'phpt_test.php.inc';
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR .
'download_test_classes.php.inc';
$statedir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
cleanall();
mkdir($statedir);
$phpunit = &new PEAR_PHPTest(true);
$tester = &new PEAR_RunTest($fakelog);
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_RunTest/teardown.php.inc?view=markup&rev=1.1
Index: pear-core/tests/PEAR_RunTest/teardown.php.inc
+++ pear-core/tests/PEAR_RunTest/teardown.php.inc
<?php
$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
function cleanall($dir = null)
{
if ($dir !== null) {
$statedir = $dir;
} else {
$statedir = $GLOBALS['statedir'];
}
clearstatcache();
if (file_exists($statedir)) {
$dp = opendir($statedir);
while ($ent = readdir($dp)) {
if (in_array($ent, array('.', '..'))) {
continue;
}
if (is_dir($statedir . DIRECTORY_SEPARATOR . $ent)) {
cleanall($statedir . DIRECTORY_SEPARATOR . $ent);
continue;
}
unlink($statedir . DIRECTORY_SEPARATOR . $ent);
}
closedir($dp);
rmdir($statedir);
}
}
cleanall($temp_path);
?>
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_RunTest/test_bug9971.phpt?view=markup&rev=1.1
Index: pear-core/tests/PEAR_RunTest/test_bug9971.phpt
+++ pear-core/tests/PEAR_RunTest/test_bug9971.phpt
--TEST--
PEAR_RunTest improve diff of failing EXPECTF test [SHOULD FAIL]
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
echo 'skip';
}
?>
--FILE--
<?php
echo "hi123\n";
echo "oops123\n";
echo "oops\n";
echo "hi\n";
// bug9971.diff should contain:
// -002: hi%d
// +002: oops123
// -003: oops%d
// +003: oops
?>
--EXPECTF--
hi%d
hi%d
oops%d
hi