diff options
author | Greg Beaver <cellog@php.net> | 2004-05-29 09:06:09 +0000 |
---|---|---|
committer | Greg Beaver <cellog@php.net> | 2004-05-29 09:06:09 +0000 |
commit | 71e0c354ff79f6eb9a7a2302bf146e7cca484ce0 (patch) | |
tree | 2398c20ccaa3d9a0e4c89010c6876baf1e720642 /pear | |
parent | 32fd0f3ffa33e74fb777530894342dbe5324f421 (diff) | |
download | php-git-71e0c354ff79f6eb9a7a2302bf146e7cca484ce0.tar.gz |
update _installFile() test for channels
Diffstat (limited to 'pear')
-rw-r--r-- | pear/tests/pear_installer2.phpt | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/pear/tests/pear_installer2.phpt b/pear/tests/pear_installer2.phpt index b834de808a..541ad71b76 100644 --- a/pear/tests/pear_installer2.phpt +++ b/pear/tests/pear_installer2.phpt @@ -1,5 +1,5 @@ --TEST-- -PEAR_Installer test #2 +PEAR_Installer test _installFile() --SKIPIF-- <?php if (!getenv('PHP_PEAR_RUNTESTS')) { @@ -304,27 +304,28 @@ if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . } $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(): |