1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

update unit tests for PEAR 1.4.0dev6, using new getDownloadURL() xml-rpc call

This commit is contained in:
Greg Beaver
2004-06-06 16:05:30 +00:00
parent 9304645cf3
commit b4ae74ae2c
4 changed files with 1288 additions and 11 deletions
+38 -1
View File
@@ -58,6 +58,43 @@ class PEAR_test_mock_pearweb {
function call($method, $params)
{
if (!isset($this->_config['xmlrpc'][$method])) {
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'php_dump.php.inc';
$args = $params;
switch (count($args)) {
case 0:
$result = $this->_remote->parentcall($method);
break;
case 1:
$result = $this->_remote->parentcall($method, $args[0]);
break;
case 2:
$result = $this->_remote->parentcall($method, $args[0], $args[1]);
break;
case 3:
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2]);
break;
case 4:
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2], $args[3]);
break;
case 5:
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2], $args[3], $args[4]);
break;
case 6:
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
break;
}
$dump = new PHP_Dump($result);
$args = new PHP_Dump($args);
if (!isset($this->_pearweb->_config['xmlrpc'][$method][serialize($args)]))
$GLOBALS['totalPHP'][$method . serialize($args)] = '$pearweb->addXmlrpcConfig("' .
$method . '", ' .
$args->toPHP() . ', ' .
$dump->toPHP() .");";
foreach($GLOBALS['totalPHP'] as $php) {
echo $php . "\n";
}
var_dump(array_keys($this->_config['xmlrpc'][$method]), $params);
die("Error - parameters not configured properly for $method");
return false;
}
if (!isset($this->_config['xmlrpc'][$method][serialize($params)])) {
@@ -74,7 +111,7 @@ class PEAR_test_mock_pearweb {
$result = $this->_remote->parentcall($method, $args[0], $args[1]);
break;
case 3:
$result = $this->_remote->parentcall_epi($method, $args[0], $args[1], $args[2]);
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2]);
break;
case 4:
$result = $this->_remote->parentcall($method, $args[0], $args[1], $args[2], $args[3]);
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -13,13 +13,13 @@
</maintainer>
</maintainers>
<release>
<version>2.0</version>
<date>2004-06-01</date>
<version>2.1</version>
<date>2004-06-04</date>
<license>PHP License</license>
<state>stable</state>
<notes>Installation package.xml for PEAR package tests</notes>
<deps>
<dep type="pkg" rel="ge" version="1.4.0dev5">PEAR</dep>
<dep type="pkg" rel="ge" version="1.4.0dev6">PEAR</dep>
<dep type="pkg" rel="ge" version="1.1">Archive_Tar</dep>
<dep type="pkg" rel="ge" version="1.2">Console_Getopt</dep>
<dep type="pkg" rel="ge" version="1.1.0">XML_RPC</dep>
+8 -7
View File
@@ -151,6 +151,7 @@ $installpackages = $installer->getDownloadedPackages();
var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages[0]['info']['version']);
$installer->configSet('preferred_state', 'beta');
$installer->setOptions(array());
echo "Test automatic version resolution (beta):\n";
$packages = array("stabilitytoolow");
@@ -180,8 +181,8 @@ $forinstall = &new PEAR_Installer($ui);
$forinstall->setOptions(array());
$installer->setOptions(array());
$forinstall->doDownload(array('pkg6'));
$pkgs = $forinstall->getDownloadedPackages();
$installer->doDownload(array('pkg6'));
$pkgs = $installer->getDownloadedPackages();
$forinstall->install($pkgs[0]['file']);
$installer->doDownload(array('pkg6'));
var_dump(get_class($a), $installer->getErrorMsgs());
@@ -284,14 +285,14 @@ array(0) {
array(0) {
}
Test download of a non-existing package version:
Caught error: No release with version '1976.9.2' found for 'pear::pkg1'
Caught error: No release of 'pear::pkg1' with version '1976.9.2' found, latest release is version '2.0b1', stability 'beta', use --force to install
string(10) "pear_error"
array(0) {
}
array(0) {
}
Test download of a non-existing package release state:
Caught error: No release with state 'snapshot' found for 'pear::pkg1'
Caught error: No release of 'pear::pkg1' with state 'snapshot' found, latest release is version '2.0b1', stability 'beta', use --force to install
string(10) "pear_error"
array(0) {
}
@@ -305,14 +306,14 @@ array(0) {
array(0) {
}
Test automatic version resolution (stable):
Caught error: pear::stabilitytoolow is state 'devel' which is less stable than state 'stable', use --force to install
Caught error: No release of 'pear::stabilitytoolow' within preferred_state of 'stable' found, latest release is version '3.0dev', stability 'devel', use --force to install
string(10) "pear_error"
array(0) {
}
array(0) {
}
Test automatic version resolution (stable) with --force:
Warning: pear::stabilitytoolow is state 'devel' which is less stable than state 'stable'
Warning: No release of 'pear::stabilitytoolow' within preferred_state of 'stable' found, latest release, version '3.0dev', stability 'devel' will be downloaded
bool(false)
array(0) {
}
@@ -343,7 +344,7 @@ array(0) {
}
string(5) "2.0b1"
Test download attempt if a version is already installed with upgrade, same version:
Package 'pear::pkg6-2.0b1' already installed, skipping
Package 'pear::pkg6', version '2.0b1' already installed, skipping
bool(false)
array(0) {
}