From: Greg Beaver Date: Thu, 4 Dec 2003 01:35:27 +0000 (+0000) Subject: finished unit test X-Git-Tag: php-5.0.0b3RC1~353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad9629d2bf40597aee76947bbcc020d97db0f1b8;p=php finished unit test --- diff --git a/pear/tests/pear_downloader_old.phpt b/pear/tests/pear_downloader_old.phpt index 8c3a322b87..6a544ac1b8 100644 --- a/pear/tests/pear_downloader_old.phpt +++ b/pear/tests/pear_downloader_old.phpt @@ -199,14 +199,9 @@ echo ($good == $dled) ? "yes\n" : "no\n"; unlink($installpackages[0]['file']); unset($installpackages[0]['file']); -chdir($curdir); -cleanall($temp_path); - echo "\n================Test --alldeps\nTest preferred_state = stable\n"; $config->set('preferred_state', 'stable'); -echo "Test simple direct url download:\n"; - $config = &PEAR_Config::singleton(); $packages = array("http://$server/get/pkg1-1.1.tgz"); $a = $installer->download($packages, array('alldeps' => true), &$config, &$installpackages, &$errors); @@ -215,7 +210,83 @@ echo "Packages downloaded and version:\n"; foreach ($installpackages as $package) { echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; } +$packages = array("pkg1"); +$a = $installer->download($packages, array('alldeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} + +echo "Test preferred_state = beta:\n"; +$config->set('preferred_state', 'beta'); + +$config = &PEAR_Config::singleton(); +$packages = array("pkg1"); +$a = $installer->download($packages, array('alldeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} + +echo "Test preferred_state = alpha:\n"; +$config->set('preferred_state', 'alpha'); + +$config = &PEAR_Config::singleton(); +$packages = array("pkg1"); +$a = $installer->download($packages, array('alldeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} +echo "\n================Test --onlyreqdeps\nTest preferred_state = stable\n"; +$config->set('preferred_state', 'stable'); + +$config = &PEAR_Config::singleton(); +$packages = array("http://$server/get/pkg1-1.1.tgz"); +$a = $installer->download($packages, array('onlyreqdeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} +$packages = array("pkg1"); +$a = $installer->download($packages, array('onlyreqdeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} + +echo "Test preferred_state = beta:\n"; +$config->set('preferred_state', 'beta'); +$config = &PEAR_Config::singleton(); +$packages = array("pkg1"); +$a = $installer->download($packages, array('onlyreqdeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} + +echo "Test preferred_state = alpha:\n"; +$config->set('preferred_state', 'alpha'); + +$config = &PEAR_Config::singleton(); +$packages = array("pkg1"); +$a = $installer->download($packages, array('onlyreqdeps' => true), &$config, &$installpackages, &$errors); +var_dump($a, $errors); +echo "Packages downloaded and version:\n"; +foreach ($installpackages as $package) { + echo $package['pkg'] . '-' . $package['info']['version'] . "\n"; +} + + +chdir($curdir); +cleanall($temp_path); /* echo "File exists? "; echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n"; @@ -428,7 +499,6 @@ File is the same? yes ================Test --alldeps Test preferred_state = stable -Test simple direct url download: Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class NULL array(0) { @@ -439,4 +509,90 @@ pkg2-1.1 pkg3-1.1 pkg4-1.1 pkg5-1.1 -pkg6-1.1 \ No newline at end of file +pkg6-1.1 +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-1.1 +pkg2-1.1 +pkg3-1.1 +pkg4-1.1 +pkg5-1.1 +pkg6-1.1 +Test preferred_state = beta: +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-2.0b1 +pkg2-1.1 +pkg3-1.1 +pkg4-1.1 +pkg5-1.1 +pkg6-2.0b1 +Test preferred_state = alpha: +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-2.0b1 +pkg2-1.1 +pkg3-1.4 +pkg4AndAHalf-1.3 +pkg4-1.1 +pkg5-1.1 +pkg6-2.0b1 + +================Test --onlyreqdeps +Test preferred_state = stable +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-1.1 +pkg2-1.1 +pkg3-1.1 +pkg4-1.1 +pkg5-1.1 +pkg6-1.1 +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-1.1 +pkg2-1.1 +pkg3-1.1 +pkg4-1.1 +pkg5-1.1 +pkg6-1.1 +Test preferred_state = beta: +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-2.0b1 +pkg2-1.1 +pkg3-1.1 +pkg4-1.1 +pkg5-1.1 +pkg6-2.0b1 +Test preferred_state = alpha: +skipping Package pkg3 optional dependency pkg4AndAHalf +Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class +NULL +array(0) { +} +Packages downloaded and version: +pkg1-2.0b1 +pkg2-1.1 +pkg3-1.4 +pkg4-1.1 +pkg5-1.1 +pkg6-2.0b1 \ No newline at end of file