From: Greg Beaver Date: Fri, 31 Oct 2003 22:53:31 +0000 (+0000) Subject: add optional dependencies to test X-Git-Tag: php-5.0.0b3RC1~802 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=014d039459eca139b29699ee32c3e75f29e91585;p=php add optional dependencies to test --- diff --git a/pear/tests/pear_dependency_checkPackage.phpt b/pear/tests/pear_dependency_checkPackage.phpt index 3bda242fa1..75e29d4e51 100644 --- a/pear/tests/pear_dependency_checkPackage.phpt +++ b/pear/tests/pear_dependency_checkPackage.phpt @@ -2,11 +2,12 @@ PEAR_Dependency::checkPackage() test --SKIPIF-- --FILE-- checkPackage($msg, 'pkg2', null, 'has'); +echo 'has pkg2 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_MISSING? '; +echo ($ret == PEAR_DEPENDENCY_MISSING) ? "yes\n" : "no\n"; +echo $msg . "\n"; + +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg2', null, 'has', true); +echo 'has optional pkg2 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_MISSING_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_MISSING_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', '0.9', 'le'); echo 'le 0.9 works? '; @@ -84,6 +101,14 @@ echo '$ret is PEAR_DEPENDENCY_CONFLICT? '; echo ($ret == PEAR_DEPENDENCY_CONFLICT) ? "yes\n" : "no\n"; echo $msg . "\n"; +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg1', '0.9', 'le', true); +echo 'optional le 0.9 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_CONFLICT_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_CONFLICT_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'ne'); echo 'ne 1.0 works? '; @@ -92,6 +117,14 @@ echo '$ret is PEAR_DEPENDENCY_CONFLICT? '; echo ($ret == PEAR_DEPENDENCY_CONFLICT) ? "yes\n" : "no\n"; echo $msg . "\n"; +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'ne', true); +echo 'optional ne 1.0 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_CONFLICT_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_CONFLICT_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', '1.1', 'ge'); echo 'ge 1.1 works? '; @@ -100,6 +133,14 @@ echo '$ret is PEAR_DEPENDENCY_UPGRADE_MINOR? '; echo ($ret == PEAR_DEPENDENCY_UPGRADE_MINOR) ? "yes\n" : "no\n"; echo $msg . "\n"; +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg1', '1.1', 'ge', true); +echo 'optional ge 1.1 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', '2.0', 'ge'); echo 'ge 2.0 works? '; @@ -108,6 +149,14 @@ echo '$ret is PEAR_DEPENDENCY_UPGRADE_MAJOR? '; echo ($ret == PEAR_DEPENDENCY_UPGRADE_MAJOR) ? "yes\n" : "no\n"; echo $msg . "\n"; +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg1', '2.0', 'ge', true); +echo 'optional ge 2.0 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_UPGRADE_MAJOR_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_UPGRADE_MAJOR_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'gt'); echo 'gt 1.0 works? '; @@ -116,6 +165,14 @@ echo '$ret is PEAR_DEPENDENCY_UPGRADE_MINOR? '; echo ($ret == PEAR_DEPENDENCY_UPGRADE_MINOR) ? "yes\n" : "no\n"; echo $msg . "\n"; +$msg = 'no error'; +$ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'gt', true); +echo 'optional gt 1.0 works? '; +echo $ret ? "no\n" : "yes\n"; +echo '$ret is PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL? '; +echo ($ret == PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL) ? "yes\n" : "no\n"; +echo $msg . "\n"; + $msg = 'no error'; $ret = $dep->checkPackage($msg, 'pkg1', null, 'not'); echo 'not pkg1 works? '; @@ -165,21 +222,42 @@ ge 0.9 works? yes no error not pkg2 works? yes no error +has pkg2 works? no +$ret is PEAR_DEPENDENCY_MISSING? yes +requires package `pkg2' +has optional pkg2 works? no +$ret is PEAR_DEPENDENCY_MISSING_OPTIONAL? yes +package `pkg2' is recommended to utilize some features. le 0.9 works? no $ret is PEAR_DEPENDENCY_CONFLICT? yes requires package `pkg1' <= 0.9 +optional le 0.9 works? no +$ret is PEAR_DEPENDENCY_CONFLICT_OPTIONAL? yes +package `pkg1' version <= 0.9 is recommended to utilize some features. Installed version is 1.0 ne 1.0 works? no $ret is PEAR_DEPENDENCY_CONFLICT? yes requires package `pkg1' != 1.0 +optional ne 1.0 works? no +$ret is PEAR_DEPENDENCY_CONFLICT_OPTIONAL? yes +package `pkg1' version != 1.0 is recommended to utilize some features. Installed version is 1.0 ge 1.1 works? no $ret is PEAR_DEPENDENCY_UPGRADE_MINOR? yes requires package `pkg1' >= 1.1 +optional ge 1.1 works? no +$ret is PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL? yes +package `pkg1' version >= 1.1 is recommended to utilize some features. Installed version is 1.0 ge 2.0 works? no $ret is PEAR_DEPENDENCY_UPGRADE_MAJOR? yes requires package `pkg1' >= 2.0 +optional ge 2.0 works? no +$ret is PEAR_DEPENDENCY_UPGRADE_MAJOR_OPTIONAL? yes +package `pkg1' version >= 2.0 is recommended to utilize some features. Installed version is 1.0 gt 1.0 works? no $ret is PEAR_DEPENDENCY_UPGRADE_MINOR? yes requires package `pkg1' > 1.0 +optional gt 1.0 works? no +$ret is PEAR_DEPENDENCY_UPGRADE_MINOR_OPTIONAL? yes +package `pkg1' version > 1.0 is recommended to utilize some features. Installed version is 1.0 not pkg1 works? no $ret is PEAR_DEPENDENCY_CONFLICT? yes conflicts with package `pkg1'