cvs: php-src /pear/tests pear_installer2.phpt

From: Date: Sat, 29 May 2004 09:06:09 +0000
Subject: cvs: php-src /pear/tests pear_installer2.phpt
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-350@lists.php.net to get a copy of this message
cellog Sat May 29 05:06:09 2004 EDT Modified files: /php-src/pear/tests pear_installer2.phpt Log: update _installFile() test for channels http://cvs.php.net/diff.php/php-src/pear/tests/pear_installer2.phpt?r1=1.10&r2=1.11&ty=u Index: php-src/pear/tests/pear_installer2.phpt diff -u php-src/pear/tests/pear_installer2.phpt:1.10 php-src/pear/tests/pear_installer2.phpt:1.11 --- php-src/pear/tests/pear_installer2.phpt:1.10 Wed May 19 04:45:23 2004 +++ php-src/pear/tests/pear_installer2.phpt Sat May 29 05:06:09 2004 @@ -1,5 +1,5 @@ --TEST-- -PEAR_Installer test #2 +PEAR_Installer test _installFile() --SKIPIF-- <?php if (!getenv('PHP_PEAR_RUNTESTS')) { @@ -304,27 +304,28 @@ } $installer->rollbackFileTransaction(); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . - 'Foo' . DIRECTORY_SEPARATOR . 'Mine'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . - 'Foo'); -unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php'); //cleanup chdir($curdir); -unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.conf'); -unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.ini'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'php'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'Foo'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'data'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'doc' . DIRECTORY_SEPARATOR . 'Foo'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'doc'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'Foo'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'test'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'script'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'ext'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'tmp'); -rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin'); -rmdir($temp_path); +cleanall($temp_path); + +// ------------------------------------------------------------------------- // + +function cleanall($dir) +{ + $dp = opendir($dir); + while ($ent = readdir($dp)) { + if ($ent == '.' || $ent == '..') { + continue; + } + if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) { + cleanall($dir . DIRECTORY_SEPARATOR . $ent); + } else { + unlink($dir . DIRECTORY_SEPARATOR . $ent); + } + } + closedir($dp); + rmdir($dir); +} ?> --EXPECT-- test _installFile():

« previous php.pear.core (#350) next »