cvs: pear /PEAR_Command_Packaging/tests mock_classes.php.inc phpt_test.php.inc setup.php.inc test1.phpt

From: Date: Wed, 15 Feb 2006 16:51:43 +0000
Subject: cvs: pear /PEAR_Command_Packaging/tests mock_classes.php.inc phpt_test.php.inc setup.php.inc test1.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38260@lists.php.net to get a copy of this message
timj Wed Feb 15 16:51:43 2006 UTC Removed files: /pear/PEAR_Command_Packaging/tests mock_classes.php.inc phpt_test.php.inc test1.phpt Modified files: /pear/PEAR_Command_Packaging/tests setup.php.inc Log: Remove example tests in prep for putting in some real ones http://cvs.php.net/viewcvs.cgi/pear/PEAR_Command_Packaging/tests/setup.php.inc?r1=1.1&r2=1.2&diff_format=u Index: pear/PEAR_Command_Packaging/tests/setup.php.inc diff -u pear/PEAR_Command_Packaging/tests/setup.php.inc:1.1 pear/PEAR_Command_Packaging/tests/setup.php.inc:1.2 --- pear/PEAR_Command_Packaging/tests/setup.php.inc:1.1 Thu Jan 12 02:47:04 2006 +++ pear/PEAR_Command_Packaging/tests/setup.php.inc Wed Feb 15 16:51:43 2006 @@ -1,10 +1,11 @@ <?php -// general test setup +$server = 'pear.Chiara'; +//$server = 'test.pear.php.net'; $temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp'; -require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mock_classes.php.inc'; -register_shutdown_function('cleanall'); +require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'download_test_classes.php.inc'; + cleanall($temp_path); $statedir = $temp_path; if (!is_dir($temp_path)) { @@ -55,6 +56,10 @@ $fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w'); fwrite($fp, $config); fclose($fp); +touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf'); +$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w'); +fwrite($fp, $config); +fclose($fp); putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path); $home = getenv('HOME'); @@ -62,24 +67,13 @@ // for PEAR_Config initialization putenv('HOME="'.$temp_path); } -require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpt_test.php.inc'; +require_once "PEAR/ChannelFile.php"; +require_once dirname(dirname(__FILE__)) . '/download_test_classes.php.inc'; +require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'phpt_test.php.inc'; $phpunit = &new PEAR_PHPTest(true); $fakelog = new fake_log; -$config = &test_PEAR_Config::singleton($temp_path . '/pear.ini'); -test_PEAR_Dependency2::singleton($config); -/** - * @param array - * @return test_PEAR_Downloader_Package - */ -function &newFakeDownloaderPackage($options) -{ - global $config, $fakelog; - $downloader = &new test_PEAR_Downloader($fakelog, $options, $config); - $p = &new test_PEAR_Downloader_Package($downloader); - return $p; -} +$config = &new test_PEAR_Config($temp_path . '/pear.ini', $temp_path . '/pear.conf'); -// test setup specific to PEAR_Command_Packaging require_once 'PEAR/Command/Packaging.php'; class test_PEAR_Command_Packaging extends PEAR_Command_Packaging { @@ -95,7 +89,18 @@ $a = &new test_PEAR_Installer($this->ui, array(), $this->config); return $a; } - + + // this is not used at the moment as the output from the installer (featuring paths) + // is not examined, but may be useful in future as it provides a "known" temp + // directory name rather than the random one from System::mktemp + function makeTempDir() + { + static $a = 0; + $dir = $GLOBALS['temp_path'] . DIRECTORY_SEPARATOR . 'pear2rpm-temp' . $a++; + mkdir($dir); + return $dir; + } } + $command = &new test_PEAR_Command_Packaging($fakelog, $config); ?> \ No newline at end of file

« previous php.pear.cvs (#38260) next »