summaryrefslogtreecommitdiff
path: root/pear/tests
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2001-10-11 22:11:34 +0000
committerStig Bakken <ssb@php.net>2001-10-11 22:11:34 +0000
commit405142087ca9f49f6f480e29541bb3fe05847fe8 (patch)
treec84afd0ac0031427f16272ec3a308805f3fc577d /pear/tests
parentb26fbe41b188b2b6c65a175faa1abb84417d8a1a (diff)
downloadphp-git-405142087ca9f49f6f480e29541bb3fe05847fe8.tar.gz
* replaced PEAR::phpVersionIs with version_compare
Diffstat (limited to 'pear/tests')
-rw-r--r--pear/tests/pear_versioncmp.phpt65
1 files changed, 0 insertions, 65 deletions
diff --git a/pear/tests/pear_versioncmp.phpt b/pear/tests/pear_versioncmp.phpt
deleted file mode 100644
index 4611623d52..0000000000
--- a/pear/tests/pear_versioncmp.phpt
+++ /dev/null
@@ -1,65 +0,0 @@
---TEST--
-PEAR::phpVersionIs()
---SKIPIF--
---FILE--
-<?php
-// Test for PEAR::phpVersionIs()
-
-require_once '../PEAR.php';
-
-define (PHP_CURRENT_VER, '4.0.7');
-
-function cmp($param1=null, $param2=null, $expected)
-{
- echo PHP_CURRENT_VER;
- if ($param1) {
- echo " minor than $param1";
- }
- if ($param2) {
- echo " greater than $param2";
- }
- $res = PEAR::phpVersionIs($param1, $param2, PHP_CURRENT_VER);
- echo " is ";
- echo ($res) ? "TRUE" : "FALSE";
- if ($expected === $res) {
- echo " OK\n";
- } else {
- echo " FAIL\n";
- }
-}
-$vers = array(
- array('4.0.5', null, false),
- array('4.0.99', null, true),
- array(PHP_CURRENT_VER, null, false),
- array('4.0.99pl1', null, true),
- array('4.0.99RC1', null, true),
- array('4.0.99-dev', null, true),
- array(null, '4.0.5', true),
- array(null, '4.0.99', false),
- array(null, PHP_CURRENT_VER, false),
- array('4.0.5', '4.0.99', false),
- array('4.0.99', '4.0.5', true),
- array(PHP_CURRENT_VER, '4.0.5', false),
- array('4.0.99', PHP_CURRENT_VER, false)
-);
-
-foreach ($vers as $ver) {
- cmp($ver[0], $ver[1], $ver[2]);
-}
-?>
---GET--
---POST--
---EXPECT--
-4.0.7 minor than 4.0.5 is FALSE OK
-4.0.7 minor than 4.0.99 is TRUE OK
-4.0.7 minor than 4.0.7 is FALSE OK
-4.0.7 minor than 4.0.99pl1 is TRUE OK
-4.0.7 minor than 4.0.99RC1 is TRUE OK
-4.0.7 minor than 4.0.99-dev is TRUE OK
-4.0.7 greater than 4.0.5 is TRUE OK
-4.0.7 greater than 4.0.99 is FALSE OK
-4.0.7 greater than 4.0.7 is FALSE OK
-4.0.7 minor than 4.0.5 greater than 4.0.99 is FALSE OK
-4.0.7 minor than 4.0.99 greater than 4.0.5 is TRUE OK
-4.0.7 minor than 4.0.7 greater than 4.0.5 is FALSE OK
-4.0.7 minor than 4.0.99 greater than 4.0.7 is FALSE OK