summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pear/tests/common_sortPkgDeps1_package.xml38
-rw-r--r--pear/tests/common_sortPkgDeps2_package.xml39
-rw-r--r--pear/tests/common_sortPkgDeps3_package.xml39
-rw-r--r--pear/tests/common_sortPkgDeps4_package.xml38
-rw-r--r--pear/tests/common_sortPkgDeps5_package.xml38
-rw-r--r--pear/tests/common_sortPkgDeps6_package.xml35
-rw-r--r--pear/tests/dirtree/multiplepackages/pkg1file.php0
-rw-r--r--pear/tests/dirtree/multiplepackages/pkg2file.php0
-rw-r--r--pear/tests/dirtree/nestedroot/emptydir/fakefile1.php0
-rw-r--r--pear/tests/dirtree/nestedroot/emptydir/nesteddir/nestedfile.php0
-rw-r--r--pear/tests/dirtree/nestedroot/rootfile.php0
-rw-r--r--pear/tests/dirtree/package-fail.xml42
-rw-r--r--pear/tests/dirtree/package.xml36
-rw-r--r--pear/tests/dirtree/package2.xml41
-rw-r--r--pear/tests/dirtree/pkg1-1.0.tgzbin560 -> 0 bytes
-rw-r--r--pear/tests/dirtree/pkg2-1.0.tgzbin608 -> 0 bytes
-rw-r--r--pear/tests/pear2.phpt852
-rw-r--r--pear/tests/pear_common_analyzeSC.phpt164
-rw-r--r--pear/tests/pear_common_buildProvidesArray.phpt143
-rw-r--r--pear/tests/pear_common_downloadHttp.phpt216
-rw-r--r--pear/tests/pear_common_infoFromString.phpt1754
-rw-r--r--pear/tests/pear_common_sortPkgDeps.phpt75
-rw-r--r--pear/tests/pear_common_validPackageVersion.phpt83
-rw-r--r--pear/tests/pear_dependency_checkExtension.phpt262
-rw-r--r--pear/tests/pear_dependency_checkPackage.phpt269
-rw-r--r--pear/tests/pear_dependency_checkPackageUninstall.phpt178
-rw-r--r--pear/tests/pear_downloader_invalid.phpt366
-rw-r--r--pear/tests/pear_downloader_new.phpt570
-rw-r--r--pear/tests/pear_downloader_old.phpt598
-rw-r--r--pear/tests/pear_installer1.phpt104
-rw-r--r--pear/tests/pear_installer2.phpt399
-rw-r--r--pear/tests/pear_installer3.phpt417
-rw-r--r--pear/tests/pear_installer4.phpt259
-rw-r--r--pear/tests/pear_installer5.phpt226
-rw-r--r--pear/tests/pear_packager.phpt432
-rw-r--r--pear/tests/test-pkg6/goompness/Mopreeb.php11
-rw-r--r--pear/tests/test-pkg6/goompness/oggbrzitzkee.php11
-rw-r--r--pear/tests/test-pkg6/invalidtgz.tgz35
-rw-r--r--pear/tests/test-pkg6/nopackagexml.tgzbin272 -> 0 bytes
-rw-r--r--pear/tests/test-pkg6/package.xml35
-rw-r--r--pear/tests/test-pkg6/pkg6-1.1.tgzbin673 -> 0 bytes
-rw-r--r--pear/tests/test-pkg6/pkg6-2.0b1.tgzbin725 -> 0 bytes
-rw-r--r--pear/tests/test-pkg6/zoorb.php11
-rw-r--r--pear/tests/testdownload.tgzbin41655 -> 0 bytes
44 files changed, 0 insertions, 7816 deletions
diff --git a/pear/tests/common_sortPkgDeps1_package.xml b/pear/tests/common_sortPkgDeps1_package.xml
deleted file mode 100644
index a103b10c66..0000000000
--- a/pear/tests/common_sortPkgDeps1_package.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg1</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <deps>
- <dep type="pkg" version="1.0" rel="ge">pkg2</dep>
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/common_sortPkgDeps2_package.xml b/pear/tests/common_sortPkgDeps2_package.xml
deleted file mode 100644
index 3e7c03852d..0000000000
--- a/pear/tests/common_sortPkgDeps2_package.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg2</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <deps>
- <dep type="pkg" version="1.0" rel="ge">pkg3</dep>
- <dep type="php" version="1.0" rel="ge" />
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/common_sortPkgDeps3_package.xml b/pear/tests/common_sortPkgDeps3_package.xml
deleted file mode 100644
index 830a94c70a..0000000000
--- a/pear/tests/common_sortPkgDeps3_package.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg3</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <deps>
- <dep type="pkg" version="1.0" rel="ge">pkg4</dep>
- <dep type="pkg" version="1.0" rel="ge">pkg5</dep>
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/common_sortPkgDeps4_package.xml b/pear/tests/common_sortPkgDeps4_package.xml
deleted file mode 100644
index ff3394ee56..0000000000
--- a/pear/tests/common_sortPkgDeps4_package.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg4</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <deps>
- <dep type="pkg" version="1.0" rel="ge">pkg6</dep>
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/common_sortPkgDeps5_package.xml b/pear/tests/common_sortPkgDeps5_package.xml
deleted file mode 100644
index 6dea22f403..0000000000
--- a/pear/tests/common_sortPkgDeps5_package.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg5</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <deps>
- <dep type="pkg" version="1.0" rel="ge">pkg6</dep>
- </deps>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/common_sortPkgDeps6_package.xml b/pear/tests/common_sortPkgDeps6_package.xml
deleted file mode 100644
index a196e7003b..0000000000
--- a/pear/tests/common_sortPkgDeps6_package.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg6</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="grob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/dirtree/multiplepackages/pkg1file.php b/pear/tests/dirtree/multiplepackages/pkg1file.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/pear/tests/dirtree/multiplepackages/pkg1file.php
+++ /dev/null
diff --git a/pear/tests/dirtree/multiplepackages/pkg2file.php b/pear/tests/dirtree/multiplepackages/pkg2file.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/pear/tests/dirtree/multiplepackages/pkg2file.php
+++ /dev/null
diff --git a/pear/tests/dirtree/nestedroot/emptydir/fakefile1.php b/pear/tests/dirtree/nestedroot/emptydir/fakefile1.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/pear/tests/dirtree/nestedroot/emptydir/fakefile1.php
+++ /dev/null
diff --git a/pear/tests/dirtree/nestedroot/emptydir/nesteddir/nestedfile.php b/pear/tests/dirtree/nestedroot/emptydir/nesteddir/nestedfile.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/pear/tests/dirtree/nestedroot/emptydir/nesteddir/nestedfile.php
+++ /dev/null
diff --git a/pear/tests/dirtree/nestedroot/rootfile.php b/pear/tests/dirtree/nestedroot/rootfile.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/pear/tests/dirtree/nestedroot/rootfile.php
+++ /dev/null
diff --git a/pear/tests/dirtree/package-fail.xml b/pear/tests/dirtree/package-fail.xml
deleted file mode 100644
index f2bf6f15d9..0000000000
--- a/pear/tests/dirtree/package-fail.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg2</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.0</version>
- <date>2003-12-11</date>
- <state>stable</state>
- <notes>
- second package
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="test" role="php">
- <dir name="multiplepackages" role="php">
- <file>pkg2file.php</file>
- </dir>
- <dir name="nestedroot" role="php">
- <file>rootfile.php</file>
- <dir name="emptydir" role="php">
- <dir name="nesteddir" role="php">
- <file>nestedfile.php</file>
- <file>doesntexist.php</file>
- </dir>
- </dir>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/dirtree/package.xml b/pear/tests/dirtree/package.xml
deleted file mode 100644
index 8ba556e5d0..0000000000
--- a/pear/tests/dirtree/package.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg1</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.0</version>
- <date>2003-12-11</date>
- <state>stable</state>
- <notes>
- first package
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="test" role="php">
- <dir name="multiplepackages" role="php">
- <file>pkg1file.php</file>
- </dir>
- <dir name="pkg1" role="php">
- <file>randomfile.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/dirtree/package2.xml b/pear/tests/dirtree/package2.xml
deleted file mode 100644
index c0bde59e4a..0000000000
--- a/pear/tests/dirtree/package2.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg2</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.0</version>
- <date>2003-12-11</date>
- <state>stable</state>
- <notes>
- second package
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="test" role="php">
- <dir name="multiplepackages" role="php">
- <file>pkg2file.php</file>
- </dir>
- <dir name="nestedroot" role="php">
- <file>rootfile.php</file>
- <dir name="emptydir" role="php">
- <dir name="nesteddir" role="php">
- <file>nestedfile.php</file>
- </dir>
- </dir>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/dirtree/pkg1-1.0.tgz b/pear/tests/dirtree/pkg1-1.0.tgz
deleted file mode 100644
index ab305f74a8..0000000000
--- a/pear/tests/dirtree/pkg1-1.0.tgz
+++ /dev/null
Binary files differ
diff --git a/pear/tests/dirtree/pkg2-1.0.tgz b/pear/tests/dirtree/pkg2-1.0.tgz
deleted file mode 100644
index 18bc9d2f48..0000000000
--- a/pear/tests/dirtree/pkg2-1.0.tgz
+++ /dev/null
Binary files differ
diff --git a/pear/tests/pear2.phpt b/pear/tests/pear2.phpt
deleted file mode 100644
index a0174a1963..0000000000
--- a/pear/tests/pear2.phpt
+++ /dev/null
@@ -1,852 +0,0 @@
---TEST--
-PEAR complete set/push/pop error-handling test (run from pear/tests dir)
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once "PEAR.php";
-
-class testErrorHandlingStatic {
- function doSetErrorHandlingFunction()
- {
- print "testing in class setErrorHandling\n";
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- }
-
- function doSetErrorHandlingStatic()
- {
- print "testing in class setErrorHandling array(obj, method)\n";
- $obj = new testErrorHandlingPEAR;
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- }
-
- function doSetErrorHandlingObject()
- {
- print "testing in class setErrorHandling array(class, method)\n";
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- }
-
- function doPushErrorHandlingFunction()
- {
- print "testing in class pushErrorHandling\n";
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPushErrorHandlingObject()
- {
- print "testing in class pushErrorHandling array(obj, method)\n";
- $obj = new testErrorHandlingPEAR;
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPushErrorHandlingStatic()
- {
- print "testing in class pushErrorHandling array(class, method)\n";
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPopErrorHandling()
- {
- print "testing in class popErrorHandling\n";
- PEAR::popErrorHandling();
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function fakeHandleError($err)
- {
- }
-}
-
-class testErrorHandlingPEAR extends PEAR {
-
- function fakeHandleError($err)
- {
- }
-
- function doSetErrorHandlingFunction()
- {
- print "testing in PEAR setErrorHandling\n";
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- echoPEARVars('$this->_default_error_mode', $this->_default_error_mode,
- '$this->_default_error_options', $this->_default_error_options);
- }
-
- function doSetErrorHandlingStatic()
- {
- print "testing in PEAR setErrorHandling array(obj, method)\n";
- $obj = new testErrorHandlingPEAR;
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- echoPEARVars('$this->_default_error_mode', $this->_default_error_mode,
- '$this->_default_error_options', $this->_default_error_options);
- }
-
- function doSetErrorHandlingObject()
- {
- print "testing in PEAR setErrorHandling array(class, method)\n";
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
- echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
- echoPEARVars('$this->_default_error_mode', $this->_default_error_mode,
- '$this->_default_error_options', $this->_default_error_options);
- }
-
- function doPushErrorHandlingFunction()
- {
- print "testing in PEAR pushErrorHandling\n";
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPushErrorHandlingObject()
- {
- print "testing in PEAR pushErrorHandling array(obj, method)\n";
- $obj = new testErrorHandlingPEAR;
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPushErrorHandlingStatic()
- {
- print "testing in PEAR pushErrorHandling array(class, method)\n";
- PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-
- function doPopErrorHandling()
- {
- print "testing in PEAR popErrorHandling\n";
- PEAR::popErrorHandling();
- echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
- }
-}
-
-function echoPEARVars($name1, $mode, $name2, $options, $indent = '')
-{
- $levelMap =
- array(
- E_USER_NOTICE => 'E_USER_NOTICE',
- E_USER_WARNING => 'E_USER_WARNING',
- E_USER_ERROR => 'E_USER_ERROR',
- );
- $pearLevelMap =
- array(
- PEAR_ERROR_RETURN =>'PEAR_ERROR_RETURN',
- PEAR_ERROR_PRINT =>'PEAR_ERROR_PRINT',
- PEAR_ERROR_TRIGGER =>'PEAR_ERROR_TRIGGER',
- PEAR_ERROR_DIE =>'PEAR_ERROR_DIE',
- PEAR_ERROR_CALLBACK =>'PEAR_ERROR_CALLBACK',
- PEAR_ERROR_EXCEPTION =>'PEAR_ERROR_EXCEPTION',
- );
- print $indent . "echoing PEAR error-handling Variables:\n";
- print "$indent--------------------------------------\n";
- print $indent . "$name1:\n";
- $levels = get_error_mode($mode);
- print $indent;
- foreach($levels as $level) {
- print $pearLevelMap[$level] . ',';
- }
- print "\n";
- print $indent . "$name2:\n";
- if (is_string($options)) {
- print $indent . 'Callback: ' . $options. "()\n";
- } elseif (is_array($options)) {
- print $indent . 'Callback: ';
- if (is_string($options[0])) {
- print '(static) ' . $options[0] . '::';
- } else {
- print get_class($options[0]) . '->';
- }
- print $options[1] . "()\n";
- } else {
- print $indent . $levelMap[$options] . "\n";
- }
- print "$indent--------------------------------------\n";
-}
-
-function echoPEARStack($name, $stack)
-{
- print "stack $name:\n";
- foreach ($stack as $i => $item) {
- print "Index $i:\n";
- echoPEARVars('mode', $item[0], 'options', $item[1], ' ');
- }
-}
-
-function get_error_mode($err)
-{
- $ret = array();
- $level = 0;
- while($level < 7) {
- $a = ($err >> $level++) & 1;
- if ($a) {
- $ret[] = 1 << ($level - 1);
- }
- }
- return $ret;
-}
-print "testing static error-handling global code\n";
-echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
-print "testing setErrorHandling\n";
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
-echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
-print "testing setErrorHandling array(obj, method)\n";
-$obj = new testErrorHandlingPEAR;
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
-echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
-print "testing setErrorHandling array(class, method)\n";
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
-echoPEARVars('_PEAR_default_error_mode', $GLOBALS['_PEAR_default_error_mode'],
- '_PEAR_default_error_options', $GLOBALS['_PEAR_default_error_options']);
-
-
-print "testing pushErrorHandling\n";
-PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, 'get_error_mode');
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-print "testing pushErrorHandling array(obj, method)\n";
-$obj = new testErrorHandlingPEAR;
-PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array(&$obj, 'fakeHandleError'));
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-print "testing pushErrorHandling array(class, method)\n";
-PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array('testErrorHandlingStatic', 'fakeHandleError'));
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-
-
-print "testing popErrorHandling\n";
-PEAR::popErrorHandling();
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-print "testing popErrorHandling\n";
-$obj = new testErrorHandlingPEAR;
-PEAR::popErrorHandling();
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-print "testing popErrorHandling\n";
-PEAR::popErrorHandling();
-echoPEARStack('_PEAR_error_handler_stack', $GLOBALS['_PEAR_error_handler_stack']);
-print "*******************************************\n";
-print "testing static error-handling in-class code\n";
-print "*******************************************\n";
-PEAR::setErrorHandling(PEAR_ERROR_RETURN, E_USER_NOTICE);
-$obj = new testErrorHandlingStatic;
-$obj->doSetErrorHandlingFunction();
-$obj->doSetErrorHandlingStatic();
-$obj->doSetErrorHandlingObject();
-$obj->doPushErrorHandlingFunction();
-$obj->doPushErrorHandlingStatic();
-$obj->doPushErrorHandlingObject();
-$obj->doPopErrorHandling();
-$obj->doPopErrorHandling();
-$obj->doPopErrorHandling();
-print "*******************************************\n";
-print "testing non-static error-handling in-class code\n";
-print "*******************************************\n";
-PEAR::setErrorHandling(PEAR_ERROR_RETURN, E_USER_NOTICE);
-$obj = new testErrorHandlingPEAR;
-$obj->doSetErrorHandlingFunction();
-$obj->doSetErrorHandlingStatic();
-$obj->doSetErrorHandlingObject();
-$obj->doPushErrorHandlingFunction();
-$obj->doPushErrorHandlingStatic();
-$obj->doPushErrorHandlingObject();
-$obj->doPopErrorHandling();
-$obj->doPopErrorHandling();
-$obj->doPopErrorHandling();
-
-?>
---GET--
---POST--
---EXPECT--
-testing static error-handling global code
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_RETURN,
-_PEAR_default_error_options:
-E_USER_NOTICE
---------------------------------------
-testing setErrorHandling
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: get_error_mode()
---------------------------------------
-testing setErrorHandling array(obj, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: testerrorhandlingpear->fakeHandleError()
---------------------------------------
-testing setErrorHandling array(class, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: (static) testErrorHandlingStatic::fakeHandleError()
---------------------------------------
-testing pushErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing pushErrorHandling array(obj, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-testing pushErrorHandling array(class, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-Index 4:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-Index 5:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-testing popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-testing popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing popErrorHandling
-stack _PEAR_error_handler_stack:
-*******************************************
-testing static error-handling in-class code
-*******************************************
-testing in class setErrorHandling
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: get_error_mode()
---------------------------------------
-testing in class setErrorHandling array(obj, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: testerrorhandlingpear->fakeHandleError()
---------------------------------------
-testing in class setErrorHandling array(class, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_CALLBACK,
-_PEAR_default_error_options:
-Callback: (static) testErrorHandlingStatic::fakeHandleError()
---------------------------------------
-testing in class pushErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing in class pushErrorHandling array(class, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-testing in class pushErrorHandling array(obj, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 4:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 5:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-testing in class popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-testing in class popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing in class popErrorHandling
-stack _PEAR_error_handler_stack:
-*******************************************
-testing non-static error-handling in-class code
-*******************************************
-testing in PEAR setErrorHandling
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_RETURN,
-_PEAR_default_error_options:
-E_USER_NOTICE
---------------------------------------
-echoing PEAR error-handling Variables:
---------------------------------------
-$this->_default_error_mode:
-PEAR_ERROR_CALLBACK,
-$this->_default_error_options:
-Callback: get_error_mode()
---------------------------------------
-testing in PEAR setErrorHandling array(obj, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_RETURN,
-_PEAR_default_error_options:
-E_USER_NOTICE
---------------------------------------
-echoing PEAR error-handling Variables:
---------------------------------------
-$this->_default_error_mode:
-PEAR_ERROR_CALLBACK,
-$this->_default_error_options:
-Callback: testerrorhandlingpear->fakeHandleError()
---------------------------------------
-testing in PEAR setErrorHandling array(class, method)
-echoing PEAR error-handling Variables:
---------------------------------------
-_PEAR_default_error_mode:
-PEAR_ERROR_RETURN,
-_PEAR_default_error_options:
-E_USER_NOTICE
---------------------------------------
-echoing PEAR error-handling Variables:
---------------------------------------
-$this->_default_error_mode:
-PEAR_ERROR_CALLBACK,
-$this->_default_error_options:
-Callback: (static) testErrorHandlingStatic::fakeHandleError()
---------------------------------------
-testing in PEAR pushErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing in PEAR pushErrorHandling array(class, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-testing in PEAR pushErrorHandling array(obj, method)
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 4:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 5:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: testerrorhandlingpear->fakeHandleError()
- --------------------------------------
-testing in PEAR popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 2:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-Index 3:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-testing in PEAR popErrorHandling
-stack _PEAR_error_handler_stack:
-Index 0:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: (static) testErrorHandlingStatic::fakeHandleError()
- --------------------------------------
-Index 1:
- echoing PEAR error-handling Variables:
- --------------------------------------
- mode:
- PEAR_ERROR_CALLBACK,
- options:
- Callback: get_error_mode()
- --------------------------------------
-testing in PEAR popErrorHandling
-stack _PEAR_error_handler_stack:
diff --git a/pear/tests/pear_common_analyzeSC.phpt b/pear/tests/pear_common_analyzeSC.phpt
deleted file mode 100644
index 720c1a6c1e..0000000000
--- a/pear/tests/pear_common_analyzeSC.phpt
+++ /dev/null
@@ -1,164 +0,0 @@
---TEST--
-PEAR_Common::analyzeSourceCode test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-if (!function_exists('token_get_all')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once "PEAR/Common.php";
-
-$x = PEAR_Common::analyzeSourceCode('=+"\\//452');
-echo "first test: returns false with non-existing filename? ";
-echo $x ? "no\n" : "yes\n";
-
-$testdir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pear_common_analyzeSCtest';
-mkdir($testdir);
-
-$test1 = '
-<?php
-::error();
-?>
-';
-$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test1.php', 'w');
-fwrite($fp, $test1);
-fclose($fp);
-
-$ret = PEAR_Common::analyzeSourceCode($testdir . DIRECTORY_SEPARATOR . 'test1.php');
-echo "second test: returns false with invalid PHP? ";
-echo $ret ? "no\n" : "yes\n";
-unlink($testdir . DIRECTORY_SEPARATOR . 'test1.php');
-
-$test3 = '
-<?php
-class test
-{
- class test2 {
- }
-}
-?>
-';
-$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test3.php', 'w');
-fwrite($fp, $test3);
-fclose($fp);
-
-$ret = PEAR_Common::analyzeSourceCode($testdir . DIRECTORY_SEPARATOR . 'test3.php');
-echo "fourth test: returns false with invalid PHP? ";
-echo $ret ? "no\n" : "yes\n";
-unlink($testdir . DIRECTORY_SEPARATOR . 'test3.php');
-
-$test4 = '
-<?php
-function test()
-{
- class test2 {
- }
-}
-?>
-';
-$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test4.php', 'w');
-fwrite($fp, $test4);
-fclose($fp);
-
-$ret = PEAR_Common::analyzeSourceCode($testdir . DIRECTORY_SEPARATOR . 'test4.php');
-echo "fifth test: returns false with invalid PHP? ";
-echo $ret ? "no\n" : "yes\n";
-unlink($testdir . DIRECTORY_SEPARATOR . 'test4.php');
-
-$test5 = '
-<?php
-function test()
-{
-}
-
-if (trytofool) {
- function fool()
- {
- }
-}
-class test2 {
- function test2() {
- parent::unused();
- Greg::classes();
- $a = new Pierre;
- }
-}
-
-class blah extends test2 {
- /**
- * @nodep Stig
- */
- function blah()
- {
- Stig::rules();
- }
-}
-?>
-';
-$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test5.php', 'w');
-fwrite($fp, $test5);
-fclose($fp);
-
-$ret = PEAR_Common::analyzeSourceCode($testdir . DIRECTORY_SEPARATOR . 'test5.php');
-echo "sixth test: returns false with valid PHP? ";
-echo $ret ? "no\n" : "yes\n";
-var_dump($ret);
-unlink($testdir . DIRECTORY_SEPARATOR . 'test5.php');
-
-rmdir($testdir);
-?>
---GET--
---POST--
---EXPECT--
-first test: returns false with non-existing filename? yes
-second test: returns false with invalid PHP? yes
-fourth test: returns false with invalid PHP? yes
-fifth test: returns false with invalid PHP? yes
-sixth test: returns false with valid PHP? no
-array(5) {
- ["declared_classes"]=>
- array(2) {
- [0]=>
- string(5) "test2"
- [1]=>
- string(4) "blah"
- }
- ["declared_methods"]=>
- array(2) {
- ["test2"]=>
- array(1) {
- [0]=>
- string(5) "test2"
- }
- ["blah"]=>
- array(1) {
- [0]=>
- string(4) "blah"
- }
- }
- ["declared_functions"]=>
- array(2) {
- [0]=>
- string(4) "test"
- [1]=>
- string(4) "fool"
- }
- ["used_classes"]=>
- array(2) {
- [0]=>
- string(4) "Greg"
- [1]=>
- string(6) "Pierre"
- }
- ["inheritance"]=>
- array(1) {
- ["blah"]=>
- string(5) "test2"
- }
-} \ No newline at end of file
diff --git a/pear/tests/pear_common_buildProvidesArray.phpt b/pear/tests/pear_common_buildProvidesArray.phpt
deleted file mode 100644
index d76c3503e1..0000000000
--- a/pear/tests/pear_common_buildProvidesArray.phpt
+++ /dev/null
@@ -1,143 +0,0 @@
---TEST--
-PEAR_Common::buildProvidesArray test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-if (!function_exists('token_get_all')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once "PEAR/Common.php";
-
-$testdir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pear_common_buildProvidesArraytest';
-mkdir($testdir);
-
-$test5 = '
-<?php
-function test()
-{
-}
-
-if (trytofool) {
- function fool()
- {
- }
-}
-class test2 {
- function test2() {
- parent::unused();
- Greg::classes();
- $a = new Pierre;
- }
-}
-
-class blah extends test2 {
- /**
- * @nodep Stig
- */
- function blah()
- {
- Stig::rules();
- }
-}
-?>
-';
-$fp = fopen($testdir . DIRECTORY_SEPARATOR . 'test5.php', 'w');
-fwrite($fp, $test5);
-fclose($fp);
-
-$ret = PEAR_Common::analyzeSourceCode($testdir . DIRECTORY_SEPARATOR . 'test5.php');
-echo "pre-test: returns false with valid PHP? ";
-echo $ret ? "no\n" : "yes\n";
-var_dump($ret);
-unlink($testdir . DIRECTORY_SEPARATOR . 'test5.php');
-$common = new PEAR_Common;
-$common->buildProvidesArray($ret);
-var_dump($common->pkginfo);
-rmdir($testdir);
-?>
---GET--
---POST--
---EXPECT--
-pre-test: returns false with valid PHP? no
-array(5) {
- ["declared_classes"]=>
- array(2) {
- [0]=>
- string(5) "test2"
- [1]=>
- string(4) "blah"
- }
- ["declared_methods"]=>
- array(2) {
- ["test2"]=>
- array(1) {
- [0]=>
- string(5) "test2"
- }
- ["blah"]=>
- array(1) {
- [0]=>
- string(4) "blah"
- }
- }
- ["declared_functions"]=>
- array(2) {
- [0]=>
- string(4) "test"
- [1]=>
- string(4) "fool"
- }
- ["used_classes"]=>
- array(2) {
- [0]=>
- string(4) "Greg"
- [1]=>
- string(6) "Pierre"
- }
- ["inheritance"]=>
- array(1) {
- ["blah"]=>
- string(5) "test2"
- }
-}
-array(1) {
- ["provides"]=>
- array(4) {
- ["class;test2"]=>
- array(2) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(5) "test2"
- }
- ["class;blah"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(4) "blah"
- ["extends"]=>
- string(5) "test2"
- }
- ["function;test"]=>
- array(2) {
- ["type"]=>
- string(8) "function"
- ["name"]=>
- string(4) "test"
- }
- ["function;fool"]=>
- array(2) {
- ["type"]=>
- string(8) "function"
- ["name"]=>
- string(4) "fool"
- }
- }
-} \ No newline at end of file
diff --git a/pear/tests/pear_common_downloadHttp.phpt b/pear/tests/pear_common_downloadHttp.phpt
deleted file mode 100644
index b11d904191..0000000000
--- a/pear/tests/pear_common_downloadHttp.phpt
+++ /dev/null
@@ -1,216 +0,0 @@
---TEST--
-PEAR_Common::downloadHttp test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-$fp = @fsockopen('pear.php.net', 80);
-if (!$fp) {
- echo 'skip';
-} else {
- fclose($fp);
-}
-?>
---FILE--
-<?php
-mkdir($temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testDownloadHttp');
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR=' . $temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-
-require_once "PEAR/Common.php";
-
-$common = &new PEAR_Common;
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-
-function catchit($err)
-{
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-echo "Test static:\n";
-
-echo "Simple: ";
-PEAR_Common::downloadHttp('http://test.pear.php.net/testdownload.tgz', $ui, $temp_path);
-$firstone = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testdownload.tgz'));
-$secondone = implode('', file($temp_path . DIRECTORY_SEPARATOR . 'testdownload.tgz'));
-echo ($firstone == $secondone) ? "passed\n" : "failed\n";
-
-echo "Simple fail:\n";
-PEAR_Common::downloadHttp('http://test.poop.php.net/stuff.tgz', $ui, $temp_path);
-
-echo "Test callback:\n";
-
-$ui = 'My UI';
-
-PEAR_Common::downloadHttp('http://test.pear.php.net/testdownload.tgz', $ui, $temp_path, 'myCallback');
-$firstone = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testdownload.tgz'));
-$secondone = implode('', file($temp_path . DIRECTORY_SEPARATOR . 'testdownload.tgz'));
-echo "Working Callback: ";
-echo ($firstone == $secondone) ? "passed\n" : "failed\n";
-
-
-function myCallback($message, $payload)
-{
- $stuff = serialize($payload);
- echo "Callback Message: $message\n";
- echo "Callback Payload: $stuff\n";
-}
-
-echo "Callback fail:\n";
-PEAR_Common::downloadHttp('http://test.poop.php.net/stuff.tgz', $ui, $temp_path, 'myCallback');
-
-cleanall($temp_path);
-
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-Test static:
-Simple: passed
-Simple fail:
-Caught error: Connection to `test.poop.php.net:80' failed: The operation completed successfully.
-
-Test callback:
-Callback Message: setup
-Callback Payload: a:1:{i:0;s:5:"My UI";}
-Callback Message: message
-Callback Payload: s:35:"Using HTTP proxy test.pear.php.net:";
-Callback Message: saveas
-Callback Payload: s:16:"testdownload.tgz";
-Callback Message: start
-Callback Payload: a:2:{i:0;s:16:"testdownload.tgz";i:1;s:5:"41655";}
-Callback Message: bytesread
-Callback Payload: i:1024;
-Callback Message: bytesread
-Callback Payload: i:2048;
-Callback Message: bytesread
-Callback Payload: i:3072;
-Callback Message: bytesread
-Callback Payload: i:4096;
-Callback Message: bytesread
-Callback Payload: i:5120;
-Callback Message: bytesread
-Callback Payload: i:6144;
-Callback Message: bytesread
-Callback Payload: i:7168;
-Callback Message: bytesread
-Callback Payload: i:8192;
-Callback Message: bytesread
-Callback Payload: i:9216;
-Callback Message: bytesread
-Callback Payload: i:10240;
-Callback Message: bytesread
-Callback Payload: i:11264;
-Callback Message: bytesread
-Callback Payload: i:12288;
-Callback Message: bytesread
-Callback Payload: i:13312;
-Callback Message: bytesread
-Callback Payload: i:14336;
-Callback Message: bytesread
-Callback Payload: i:15360;
-Callback Message: bytesread
-Callback Payload: i:16384;
-Callback Message: bytesread
-Callback Payload: i:17408;
-Callback Message: bytesread
-Callback Payload: i:18432;
-Callback Message: bytesread
-Callback Payload: i:19456;
-Callback Message: bytesread
-Callback Payload: i:20480;
-Callback Message: bytesread
-Callback Payload: i:21504;
-Callback Message: bytesread
-Callback Payload: i:22528;
-Callback Message: bytesread
-Callback Payload: i:23552;
-Callback Message: bytesread
-Callback Payload: i:24576;
-Callback Message: bytesread
-Callback Payload: i:25600;
-Callback Message: bytesread
-Callback Payload: i:26624;
-Callback Message: bytesread
-Callback Payload: i:27648;
-Callback Message: bytesread
-Callback Payload: i:28672;
-Callback Message: bytesread
-Callback Payload: i:29696;
-Callback Message: bytesread
-Callback Payload: i:30720;
-Callback Message: bytesread
-Callback Payload: i:31744;
-Callback Message: bytesread
-Callback Payload: i:32768;
-Callback Message: bytesread
-Callback Payload: i:33792;
-Callback Message: bytesread
-Callback Payload: i:34816;
-Callback Message: bytesread
-Callback Payload: i:35840;
-Callback Message: bytesread
-Callback Payload: i:36864;
-Callback Message: bytesread
-Callback Payload: i:37888;
-Callback Message: bytesread
-Callback Payload: i:38912;
-Callback Message: bytesread
-Callback Payload: i:39936;
-Callback Message: bytesread
-Callback Payload: i:40960;
-Callback Message: bytesread
-Callback Payload: i:41655;
-Callback Message: done
-Callback Payload: i:41655;
-Working Callback: passed
-Callback fail:
-Callback Message: setup
-Callback Payload: a:1:{i:0;s:5:"My UI";}
-Callback Message: message
-Callback Payload: s:35:"Using HTTP proxy test.poop.php.net:";
-Callback Message: connfailed
-Callback Payload: a:4:{i:0;s:17:"test.poop.php.net";i:1;i:80;i:2;i:0;i:3;s:39:"The operation completed successfully.
-";}
-Caught error: Connection to `test.poop.php.net:80' failed: The operation completed successfully. \ No newline at end of file
diff --git a/pear/tests/pear_common_infoFromString.phpt b/pear/tests/pear_common_infoFromString.phpt
deleted file mode 100644
index fa45390afb..0000000000
--- a/pear/tests/pear_common_infoFromString.phpt
+++ /dev/null
@@ -1,1754 +0,0 @@
---TEST--
-PEAR_Common::infoFromString test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-if (!function_exists('token_get_all')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-putenv('PHP_PEAR_SYSCONF_DIR=' . dirname(__FILE__));
-
-require_once "PEAR/Common.php";
-
-$common = &new PEAR_Common;
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-
-function catchit($err)
-{
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-echo "Test invalid XML\n";
-
-$common->infoFromString('\\goober');
-
-echo "Test valid XML, not a package.xml\n";
-
-$common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- "\n<grobbage></grobbage>");
-
-echo "Test valid package.xml, invalid version number\n";
-
-$common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="10000000"></package>');
-
-echo "Test empty package.xml\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"></package>');
-
-var_dump($ret);
-
-echo "Test 1\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name></package>');
-
-var_dump($ret);
-
-echo "Test 2\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '</package>');
-
-var_dump($ret);
-
-echo "Test 3\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description></package>');
-
-var_dump($ret);
-
-echo "Test 4\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license></package>');
-
-var_dump($ret);
-
-echo "Test 5\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers>
-</package>');
-
-var_dump($ret);
-
-echo "Test 6\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version></release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 7\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes></release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 8\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes>
- <provides type="class" name="furngy" /></release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 9\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes>
- <provides type="class" name="furngy" />
- <deps>
- <dep type="ext" rel="has" optional="yes">xmlrpc</dep>
- </deps>
-</release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 10\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes>
- <provides type="class" name="furngy" />
- <deps>
- <dep type="ext" rel="has" optional="yes">xmlrpc</dep>
- </deps>
- <filelist>
- <file role="data" name="package.dtd"/>
- <file role="data" name="template.spec"/>
- <file role="php" name="PEAR.php"/>
- <file role="php" name="System.php"/>
- <dir name="PEAR">
- <file role="php" name="Autoloader.php"/>
- <file role="php" name="Command.php"/>
- <dir name="Command">
- <file role="php" name="Auth.php"/>
- <file role="php" name="Build.php"/>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Install.php"/>
- <file role="php" name="Package.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- <file role="php" name="Mirror.php"/>
- </dir>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Dependency.php"/>
- <dir name="Frontend">
- <file role="php" name="CLI.php"/>
- </dir>
- <file role="php" name="Builder.php"/>
- <file role="php" name="Installer.php"/>
- <file role="php" name="Packager.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- </dir>
- <dir name="OS">
- <file role="php" name="Guess.php"/>
- </dir>
- <dir name="scripts" baseinstalldir="/">
- <file role="script" install-as="pear" name="pear.sh">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
- <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="php" install-as="pearcmd.php" name="pearcmd.php">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- </dir>
- </filelist>
-
-</release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 11\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes>
- <provides type="class" name="furngy" />
- <deps>
- <dep type="ext" rel="has" optional="yes">xmlrpc</dep>
- </deps>
- <filelist>
- <file role="data" name="package.dtd"/>
- <file role="data" name="template.spec"/>
- <file role="php" name="PEAR.php"/>
- <file role="php" name="System.php"/>
- <dir name="PEAR">
- <file role="php" name="Autoloader.php"/>
- <file role="php" name="Command.php"/>
- <dir name="Command">
- <file role="php" name="Auth.php"/>
- <file role="php" name="Build.php"/>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Install.php"/>
- <file role="php" name="Package.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- <file role="php" name="Mirror.php"/>
- </dir>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Dependency.php"/>
- <dir name="Frontend">
- <file role="php" name="CLI.php"/>
- </dir>
- <file role="php" name="Builder.php"/>
- <file role="php" name="Installer.php"/>
- <file role="php" name="Packager.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- </dir>
- <dir name="OS">
- <file role="php" name="Guess.php"/>
- </dir>
- <dir name="scripts" baseinstalldir="/">
- <file role="script" install-as="pear" name="pear.sh">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
- <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="php" install-as="pearcmd.php" name="pearcmd.php">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- </dir>
- </filelist>
- <configureoptions>
- <configureoption name="test" prompt="The prompt test" default="foo" />
- </configureoptions>
-</release>
-</package>');
-
-var_dump($ret);
-
-echo "Test 12\n";
-
-$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
- '<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
- '<description>The test</description><license>PHP License</license> <maintainers>
- <maintainer>
- <user>test</user>
- <role>lead</role>
- <name>test tester</name>
- <email>test@php.net</email>
- </maintainer></maintainers><release>
- <version>1.3b4</version>
- <date>2003-11-17</date>
- <state>beta</state>
- <notes>test</notes>
- <provides type="class" name="furngy" />
- <deps>
- <dep type="ext" rel="has" optional="yes">xmlrpc</dep>
- </deps>
- <filelist>
- <file role="data" name="package.dtd"/>
- <file role="data" name="template.spec"/>
- <file role="php" name="PEAR.php"/>
- <file role="php" name="System.php"/>
- <dir name="PEAR">
- <file role="php" name="Autoloader.php"/>
- <file role="php" name="Command.php"/>
- <dir name="Command">
- <file role="php" name="Auth.php"/>
- <file role="php" name="Build.php"/>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Install.php"/>
- <file role="php" name="Package.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- <file role="php" name="Mirror.php"/>
- </dir>
- <file role="php" name="Common.php"/>
- <file role="php" name="Config.php"/>
- <file role="php" name="Dependency.php"/>
- <dir name="Frontend">
- <file role="php" name="CLI.php"/>
- </dir>
- <file role="php" name="Builder.php"/>
- <file role="php" name="Installer.php"/>
- <file role="php" name="Packager.php"/>
- <file role="php" name="Registry.php"/>
- <file role="php" name="Remote.php"/>
- </dir>
- <dir name="OS">
- <file role="php" name="Guess.php"/>
- </dir>
- <dir name="scripts" baseinstalldir="/">
- <file role="script" install-as="pear" name="pear.sh">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
- <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- <file role="php" install-as="pearcmd.php" name="pearcmd.php">
- <replace from="@php_bin@" to="php_bin" type="pear-config"/>
- <replace from="@php_dir@" to="php_dir" type="pear-config"/>
- <replace from="@pear_version@" to="version" type="package-info"/>
- <replace from="@include_path@" to="php_dir" type="pear-config"/>
- </file>
- </dir>
- </filelist>
- <configureoptions>
- <configureoption name="test" prompt="The prompt test" default="foo" />
- </configureoptions>
-</release>
- <changelog>
- <release>
- <version>0.1</version>
- <date>2003-07-21</date>
- <license>PHP License</license>
- <state>alpha</state>
- <notes>First release of test</notes>
- </release>
- <release>
- <version>0.2</version>
- <date>2003-07-21</date>
- <license>PHP License</license>
- <state>alpha</state>
- <notes>Generation of package.xml from scratch is now supported. In addition,
-generation of &lt;provides&gt; is supported and so is addition of
-maintainers and configure options
-
-- Fixed a bug in &lt;release&gt; generation
-- Added _addProvides() to generate a &lt;provides&gt; section</notes>
- </release>
- </changelog>
-</package>');
-
-var_dump($ret);
-
-?>
---GET--
---POST--
---EXPECT--
-Test invalid XML
-Caught error: XML error: not well-formed (invalid token) at line 1
-Test valid XML, not a package.xml
-Caught error: Invalid Package File, no <package> tag
-Test valid package.xml, invalid version number
-Caught error: No handlers for package.xml version 10000000
-Test empty package.xml
-array(2) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
-}
-Test 1
-array(3) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
-}
-Test 2
-array(4) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
-}
-Test 3
-array(5) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
-}
-Test 4
-array(6) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
-}
-Test 5
-array(7) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
-}
-Test 6
-array(8) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
-}
-Test 7
-array(11) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
-}
-Test 8
-array(11) {
- ["provides"]=>
- array(1) {
- ["class;furngy"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(6) "furngy"
- ["explicit"]=>
- bool(true)
- }
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
-}
-Test 9
-array(12) {
- ["provides"]=>
- array(1) {
- ["class;furngy"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(6) "furngy"
- ["explicit"]=>
- bool(true)
- }
- }
- ["filelist"]=>
- &array(0) {
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
- ["release_deps"]=>
- array(1) {
- [1]=>
- array(4) {
- ["type"]=>
- string(3) "ext"
- ["rel"]=>
- string(3) "has"
- ["optional"]=>
- string(3) "yes"
- ["name"]=>
- string(6) "xmlrpc"
- }
- }
-}
-Test 10
-array(12) {
- ["provides"]=>
- array(1) {
- ["class;furngy"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(6) "furngy"
- ["explicit"]=>
- bool(true)
- }
- }
- ["filelist"]=>
- &array(28) {
- ["package.dtd"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["template.spec"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["PEAR.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["System.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Autoloader.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Auth.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Build.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Install.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Package.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Mirror.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Dependency.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Frontend\CLI.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Builder.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Installer.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Packager.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["OS\Guess.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["scripts\pear.sh"]=>
- array(4) {
- ["role"]=>
- string(6) "script"
- ["install-as"]=>
- string(4) "pear"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pear.bat"]=>
- array(5) {
- ["role"]=>
- string(6) "script"
- ["platform"]=>
- string(7) "windows"
- ["install-as"]=>
- string(8) "pear.bat"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(3) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@bin_dir@"
- ["to"]=>
- string(7) "bin_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pearcmd.php"]=>
- array(4) {
- ["role"]=>
- string(3) "php"
- ["install-as"]=>
- string(11) "pearcmd.php"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
- ["release_deps"]=>
- array(1) {
- [1]=>
- array(4) {
- ["type"]=>
- string(3) "ext"
- ["rel"]=>
- string(3) "has"
- ["optional"]=>
- string(3) "yes"
- ["name"]=>
- string(6) "xmlrpc"
- }
- }
-}
-Test 11
-array(13) {
- ["provides"]=>
- array(1) {
- ["class;furngy"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(6) "furngy"
- ["explicit"]=>
- bool(true)
- }
- }
- ["filelist"]=>
- &array(28) {
- ["package.dtd"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["template.spec"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["PEAR.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["System.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Autoloader.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Auth.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Build.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Install.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Package.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Mirror.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Dependency.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Frontend\CLI.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Builder.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Installer.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Packager.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["OS\Guess.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["scripts\pear.sh"]=>
- array(4) {
- ["role"]=>
- string(6) "script"
- ["install-as"]=>
- string(4) "pear"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pear.bat"]=>
- array(5) {
- ["role"]=>
- string(6) "script"
- ["platform"]=>
- string(7) "windows"
- ["install-as"]=>
- string(8) "pear.bat"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(3) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@bin_dir@"
- ["to"]=>
- string(7) "bin_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pearcmd.php"]=>
- array(4) {
- ["role"]=>
- string(3) "php"
- ["install-as"]=>
- string(11) "pearcmd.php"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
- ["release_deps"]=>
- array(1) {
- [1]=>
- array(4) {
- ["type"]=>
- string(3) "ext"
- ["rel"]=>
- string(3) "has"
- ["optional"]=>
- string(3) "yes"
- ["name"]=>
- string(6) "xmlrpc"
- }
- }
- ["configure_options"]=>
- array(1) {
- [0]=>
- array(3) {
- ["name"]=>
- string(4) "test"
- ["prompt"]=>
- string(15) "The prompt test"
- ["default"]=>
- string(3) "foo"
- }
- }
-}
-Test 12
-array(14) {
- ["provides"]=>
- array(1) {
- ["class;furngy"]=>
- array(3) {
- ["type"]=>
- string(5) "class"
- ["name"]=>
- string(6) "furngy"
- ["explicit"]=>
- bool(true)
- }
- }
- ["filelist"]=>
- &array(28) {
- ["package.dtd"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["template.spec"]=>
- array(1) {
- ["role"]=>
- string(4) "data"
- }
- ["PEAR.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["System.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Autoloader.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Auth.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Build.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Install.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Package.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Command\Mirror.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Common.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Config.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Dependency.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Frontend\CLI.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Builder.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Installer.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Packager.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Registry.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["PEAR\Remote.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["OS\Guess.php"]=>
- array(1) {
- ["role"]=>
- string(3) "php"
- }
- ["scripts\pear.sh"]=>
- array(4) {
- ["role"]=>
- string(6) "script"
- ["install-as"]=>
- string(4) "pear"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pear.bat"]=>
- array(5) {
- ["role"]=>
- string(6) "script"
- ["platform"]=>
- string(7) "windows"
- ["install-as"]=>
- string(8) "pear.bat"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(3) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@bin_dir@"
- ["to"]=>
- string(7) "bin_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- ["scripts\pearcmd.php"]=>
- array(4) {
- ["role"]=>
- string(3) "php"
- ["install-as"]=>
- string(11) "pearcmd.php"
- ["baseinstalldir"]=>
- string(1) "/"
- ["replacements"]=>
- array(4) {
- [0]=>
- array(3) {
- ["from"]=>
- string(9) "@php_bin@"
- ["to"]=>
- string(7) "php_bin"
- ["type"]=>
- string(11) "pear-config"
- }
- [1]=>
- array(3) {
- ["from"]=>
- string(9) "@php_dir@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- [2]=>
- array(3) {
- ["from"]=>
- string(14) "@pear_version@"
- ["to"]=>
- string(7) "version"
- ["type"]=>
- string(12) "package-info"
- }
- [3]=>
- array(3) {
- ["from"]=>
- string(14) "@include_path@"
- ["to"]=>
- string(7) "php_dir"
- ["type"]=>
- string(11) "pear-config"
- }
- }
- }
- }
- ["package"]=>
- string(4) "test"
- ["summary"]=>
- string(9) "PEAR test"
- ["description"]=>
- string(8) "The test"
- ["release_license"]=>
- string(11) "PHP License"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(4) "test"
- ["role"]=>
- string(4) "lead"
- ["name"]=>
- string(11) "test tester"
- ["email"]=>
- string(12) "test@php.net"
- }
- }
- ["version"]=>
- string(5) "1.3b4"
- ["release_date"]=>
- string(10) "2003-11-17"
- ["release_state"]=>
- string(4) "beta"
- ["release_notes"]=>
- string(4) "test"
- ["release_deps"]=>
- array(1) {
- [1]=>
- array(4) {
- ["type"]=>
- string(3) "ext"
- ["rel"]=>
- string(3) "has"
- ["optional"]=>
- string(3) "yes"
- ["name"]=>
- string(6) "xmlrpc"
- }
- }
- ["configure_options"]=>
- array(1) {
- [0]=>
- array(3) {
- ["name"]=>
- string(4) "test"
- ["prompt"]=>
- string(15) "The prompt test"
- ["default"]=>
- string(3) "foo"
- }
- }
- ["changelog"]=>
- array(2) {
- [0]=>
- &array(5) {
- ["version"]=>
- string(3) "0.1"
- ["release_date"]=>
- string(10) "2003-07-21"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(5) "alpha"
- ["release_notes"]=>
- string(22) "First release of test
-"
- }
- [1]=>
- &array(5) {
- ["version"]=>
- string(3) "0.2"
- ["release_date"]=>
- string(10) "2003-07-21"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(5) "alpha"
- ["release_notes"]=>
- string(260) "Generation of package.xml from scratch is now supported. In addition,
-generation of <provides> is supported and so is addition of
-maintainers and configure options
-
-- Fixed a bug in <release> generation
-- Added _addProvides() to generate a <provides> section
-"
- }
- }
-} \ No newline at end of file
diff --git a/pear/tests/pear_common_sortPkgDeps.phpt b/pear/tests/pear_common_sortPkgDeps.phpt
deleted file mode 100644
index e05cbc6a0a..0000000000
--- a/pear/tests/pear_common_sortPkgDeps.phpt
+++ /dev/null
@@ -1,75 +0,0 @@
---TEST--
-PEAR_Common::sortPkgDeps test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$dir = getcwd();
-chdir(dirname(__FILE__));
-
-require_once 'PEAR/Common.php';
-
-$c = new PEAR_Common();
-
-$packages = array(
-'common_sortPkgDeps6_package.xml',
-'common_sortPkgDeps2_package.xml',
-'common_sortPkgDeps1_package.xml',
-'common_sortPkgDeps4_package.xml',
-'common_sortPkgDeps5_package.xml',
-'common_sortPkgDeps3_package.xml',
-);
-
-$uninstallpackages = array(
-$c->infoFromAny('common_sortPkgDeps6_package.xml'),
-$c->infoFromAny('common_sortPkgDeps2_package.xml'),
-$c->infoFromAny('common_sortPkgDeps1_package.xml'),
-$c->infoFromAny('common_sortPkgDeps4_package.xml'),
-$c->infoFromAny('common_sortPkgDeps5_package.xml'),
-$c->infoFromAny('common_sortPkgDeps3_package.xml'),
-);
-
-echo "Test Install Sort:\n";
-$c->sortPkgDeps($packages);
-dumpPacks($packages);
-
-echo "Test Uninstall Sort:\n";
-$c->sortPkgDeps($uninstallpackages, true);
-dumpPacks($uninstallpackages);
-
-chdir($dir);
-
-function dumpPacks($p)
-{
- echo "Packages(\n";
- foreach ($p as $inf) {
- echo $inf['info']['package'] . ",\n";
- }
- echo ")\n";
-}
-?>
---GET--
---POST--
---EXPECT--
-Test Install Sort:
-Packages(
-pkg6,
-pkg5,
-pkg4,
-pkg3,
-pkg2,
-pkg1,
-)
-Test Uninstall Sort:
-Packages(
-pkg1,
-pkg2,
-pkg3,
-pkg5,
-pkg4,
-pkg6,
-) \ No newline at end of file
diff --git a/pear/tests/pear_common_validPackageVersion.phpt b/pear/tests/pear_common_validPackageVersion.phpt
deleted file mode 100644
index a23477a2b2..0000000000
--- a/pear/tests/pear_common_validPackageVersion.phpt
+++ /dev/null
@@ -1,83 +0,0 @@
---TEST--
-PEAR_Common::validPackageVersion test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once 'PEAR/Common.php';
-
-// '\d+(?:\.\d+)*(?:[a-z]+\d*)?'
-
-echo "==Valid Tests==\n";
-$a = '1';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1.1';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1.1.1';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1.1abc3';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.234beta4';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1alpha3';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1alpha';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1a';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-echo "==Invalid Tests==\n";
-
-$a = '1.0.0-alpha2';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1alpha.4';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-
-$a = '1.1alpha.4';
-echo "$a ";
-echo (PEAR_Common::validPackageVersion($a)) ? "valid\n" : "invalid\n";
-?>
---GET--
---POST--
---EXPECT--
-==Valid Tests==
-1 valid
-1.1 valid
-1.1.1 valid
-1.1.1.1 valid
-1.1.1abc3 valid
-1.234beta4 valid
-1alpha3 valid
-1alpha valid
-1.1a valid
-==Invalid Tests==
-1.0.0-alpha2 invalid
-1alpha.4 invalid
-1.1alpha.4 invalid
diff --git a/pear/tests/pear_dependency_checkExtension.phpt b/pear/tests/pear_dependency_checkExtension.phpt
deleted file mode 100644
index 37d808e9e4..0000000000
--- a/pear/tests/pear_dependency_checkExtension.phpt
+++ /dev/null
@@ -1,262 +0,0 @@
---TEST--
-PEAR_Dependency::checkExtension() test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-if (!ini_get('enable_dl') || ini_get('safe_mode')) {
- echo 'skip';
-}
-
-$dir = ini_get('extension_dir');
-if (OS_WINDOWS) {
- $suffix = '.dll';
-} elseif (PHP_OS == 'HP-UX') {
- $suffix = '.sl';
-} elseif (PHP_OS == 'AIX') {
- $suffix = '.a';
-} elseif (PHP_OS == 'OSX') {
- $suffix = '.bundle';
-} else {
- $suffix = '.so';
-}
-
-// get a list of possible extensions
-$extensions = array();
-if ($handle = opendir($dir)) {
- while (false !== ($file = readdir($handle))) {
- if (strpos($file, $suffix) && substr($file, 0, 4) == 'php_') {
- $extensions[] = $file;
- }
- }
- closedir($handle);
-}
-
-$loaded = false;
-$notloaded = false;
-// choose an extension for this test
-foreach ($extensions as $ext) {
- $ext = substr(substr($ext, 0, strlen($ext) - strlen($suffix)), 4);
- if (!$loaded && extension_loaded($ext)) {
- $loaded = $ext;
- }
- if (!$notloaded && !extension_loaded($ext)) {
- // safe list for testing
- if (in_array($ext, array('zip', 'bz2', 'sqlite', 'dbx'))) {
- $notloaded = $ext;
- }
- }
-}
-if (!$notloaded || !$loaded) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-@mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-require_once "PEAR/Registry.php";
-require_once "PEAR/Dependency.php";
-
-$dir = ini_get('extension_dir');
-if (OS_WINDOWS) {
- $suffix = '.dll';
-} elseif (PHP_OS == 'HP-UX') {
- $suffix = '.sl';
-} elseif (PHP_OS == 'AIX') {
- $suffix = '.a';
-} elseif (PHP_OS == 'OSX') {
- $suffix = '.bundle';
-} else {
- $suffix = '.so';
-}
-
-// get a list of possible extensions
-$extensions = array();
-if ($handle = opendir($dir)) {
- while (false !== ($file = readdir($handle))) {
- if (strpos($file, $suffix) && substr($file, 0, 4) == 'php_') {
- $extensions[] = $file;
- }
- }
- closedir($handle);
-}
-
-$loaded = false;
-$notloaded = false;
-// choose an extension for this test
-foreach ($extensions as $ext) {
- $ext = substr(substr($ext, 0, strlen($ext) - strlen($suffix)), 4);
- if (!$loaded && extension_loaded($ext)) {
- $loaded = $ext;
- }
- if (!$notloaded && !extension_loaded($ext)) {
- // safe list for testing
- if (in_array($ext, array('zip', 'bz2', 'sqlite', 'dbx'))) {
- $notloaded = $ext;
- }
- }
-}
-
-$reg = new PEAR_Registry;
-$reg->statedir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp';
-$dep = new PEAR_Dependency($reg);
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, null, 'has');
-echo 'extension 1 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $notloaded, null, 'not');
-echo 'extension 2 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$loadedver = phpversion($loaded);
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver + 1, 'ge');
-echo 'extension 3 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version >= " . ($loadedver + 1) .
- " is required" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver + 1, 'ge', true);
-echo 'extension 3 optional ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version >= " . ($loadedver + 1) .
- " is recommended to utilize some features" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'ne');
-echo 'extension 4 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version != " . $loadedver .
- " is required" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'gt');
-echo 'extension 5 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version > " . $loadedver .
- " is required" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'gt', true);
-echo 'extension 5 optional ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version > " . $loadedver .
- " is recommended to utilize some features" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'lt');
-echo 'extension 6 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version < " . $loadedver .
- " is required" ? "match\n" : "$msg\n" );
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'lt', true);
-echo 'extension 6 optional ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version < " . $loadedver .
- " is recommended to utilize some features" ? "match\n" : "$msg\n" );
-
-if ($loadedver == 0) {
- echo "extension 7 ok? no\nmessage : match\n";
- echo "extension 7 optional ok? no\nmessage : match\n";
-} else {
- $msg = 'no error';
- $ret = $dep->checkExtension($msg, $loaded, $loadedver - 1, 'le');
- echo 'extension 7 ok? ';
- echo $ret ? "no\n" : "yes\n";
- echo 'message : ' . ($msg == "'$loaded' PHP extension version <= " . ($loadedver - 1).
- " is required" ? "match\n" : "$msg\n");
-
- $msg = 'no error';
- $ret = $dep->checkExtension($msg, $loaded, $loadedver - 1, 'le', true);
- echo 'extension 7 ok? ';
- echo $ret ? "no\n" : "yes\n";
- echo 'message : ' . ($msg == "'$loaded' PHP extension version <= " . ($loadedver - 1).
- " is recommended to utilize some features" ? "match\n" : "$msg\n");
-}
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver, 'eq');
-echo 'extension 8 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $notloaded, $loadedver, 'ne');
-echo 'extension 9 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver + 1, 'eq');
-echo 'extension 10 ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version == " . ($loadedver + 1).
- " is required" ? "match\n" : "$msg\n");
-
-$msg = 'no error';
-$ret = $dep->checkExtension($msg, $loaded, $loadedver + 1, 'eq', true);
-echo 'extension 10 optional ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo 'message : ' . ($msg == "'$loaded' PHP extension version == " . ($loadedver + 1).
- " is recommended to utilize some features" ? "match\n" : "$msg\n");
-
-cleanall();
-// ------------------------------------------------------------------------- //
-
-function cleanall()
-{
- $dp = opendir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
- while ($ent = readdir($dp)) {
- if (substr($ent, -4) == ".reg") {
- unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp' . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-}
-
-?>
---GET--
---POST--
---EXPECT--
-extension 1 ok? yes
-no error
-extension 2 ok? yes
-no error
-extension 3 ok? no
-message : match
-extension 3 optional ok? no
-message : match
-extension 4 ok? no
-message : match
-extension 5 ok? no
-message : match
-extension 5 optional ok? no
-message : match
-extension 6 ok? no
-message : match
-extension 6 optional ok? no
-message : match
-extension 7 ok? no
-message : match
-extension 7 optional ok? no
-message : match
-extension 8 ok? yes
-no error
-extension 9 ok? yes
-no error
-extension 10 ok? no
-message : match
-extension 10 optional ok? no
-message : match
diff --git a/pear/tests/pear_dependency_checkPackage.phpt b/pear/tests/pear_dependency_checkPackage.phpt
deleted file mode 100644
index 1bb2120455..0000000000
--- a/pear/tests/pear_dependency_checkPackage.phpt
+++ /dev/null
@@ -1,269 +0,0 @@
---TEST--
-PEAR_Dependency::checkPackage() test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-require_once "PEAR/Registry.php";
-require_once "PEAR/Dependency.php";
-
-mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-// snarfed from pear_registry.phpt
-$reg = new PEAR_Registry;
-$reg->statedir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp';
-
-$files1 = array(
- "pkg1-1.php" => array(
- "role" => "php",
- ),
- "pkg1-2.php" => array(
- "role" => "php",
- "baseinstalldir" => "pkg1",
- ),
- );
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1));
-
-$dep = new PEAR_Dependency($reg);
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1');
-echo 'has works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'eq');
-echo 'eq 1.0 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'le');
-echo 'le 1.0 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '1.1', 'lt');
-echo 'lt 1.1 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '1.1', 'ne');
-echo 'ne 1.1 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '1.0', 'ge');
-echo 'ge 1.0 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg1', '0.9', 'gt');
-echo 'ge 0.9 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-$msg = 'no error';
-$ret = $dep->checkPackage($msg, 'pkg2', null, 'not');
-echo 'not pkg2 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-
-// error conditions
-
-$msg = 'no error';
-$ret = $dep->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? ';
-echo $ret ? "no\n" : "yes\n";
-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? ';
-echo $ret ? "no\n" : "yes\n";
-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? ';
-echo $ret ? "no\n" : "yes\n";
-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? ';
-echo $ret ? "no\n" : "yes\n";
-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? ';
-echo $ret ? "no\n" : "yes\n";
-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? ';
-echo $ret ? "no\n" : "yes\n";
-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', null, 'foobar');
-echo 'foobar pkg1 works? ';
-echo $ret ? "no\n" : "yes\n";
-echo '$ret is PEAR_DEPENDENCY_BAD_DEPENDENCY? ';
-echo ($ret == PEAR_DEPENDENCY_BAD_DEPENDENCY) ? "yes\n" : "no\n";
-echo $msg . "\n";
-cleanall();
-
-// ------------------------------------------------------------------------- //
-
-function cleanall()
-{
- $dp = opendir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
- while ($ent = readdir($dp)) {
- if (substr($ent, -4) == ".reg") {
- unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp' . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-}
-
-?>
---GET--
---POST--
---EXPECT--
-has works? yes
-no error
-eq 1.0 works? yes
-no error
-le 1.0 works? yes
-no error
-lt 1.1 works? yes
-no error
-ne 1.1 works? yes
-no error
-ge 1.0 works? yes
-no error
-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'
-foobar pkg1 works? no
-$ret is PEAR_DEPENDENCY_BAD_DEPENDENCY? yes
-relation 'foobar' with requirement '' is not supported (name=pkg1)
diff --git a/pear/tests/pear_dependency_checkPackageUninstall.phpt b/pear/tests/pear_dependency_checkPackageUninstall.phpt
deleted file mode 100644
index 0206733a1f..0000000000
--- a/pear/tests/pear_dependency_checkPackageUninstall.phpt
+++ /dev/null
@@ -1,178 +0,0 @@
---TEST--
-PEAR_Dependency::checkPackageUninstall() test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once "PEAR/Registry.php";
-require_once "PEAR/Dependency.php";
-
-// snarfed from pear_registry.phpt
-$reg = new PEAR_Registry;
-@mkdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-$reg->statedir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp';
-
-$files1 = array(
- "pkg1-1.php" => array(
- "role" => "php",
- ),
- "pkg1-2.php" => array(
- "role" => "php",
- "baseinstalldir" => "pkg1",
- ),
- );
-$files2 = array(
- "pkg2-1.php" => array(
- "role" => "php",
- ),
- "pkg2-2.php" => array(
- "role" => "php",
- "baseinstalldir" => "pkg2",
- ),
- );
-$files3 = array(
- "pkg3-1.php" => array(
- "role" => "php",
- ),
- "pkg3-2.php" => array(
- "role" => "php",
- "baseinstalldir" => "pkg3",
- ),
- );
-
-$reg->addPackage("pkg2", array("name" => "pkg2", "version" => "2.0", "filelist" => $files2));
-$reg->addPackage("pkg3", array("name" => "pkg3", "version" => "3.0", "filelist" => $files3));
-
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1,
- 'release_deps' => array(
- array('type' => 'pkg', 'name' => 'pkg3', 'rel' => 'not')
- )));
-
-$dep = new PEAR_Dependency($reg);
-$msg = '';
-$warn = '';
-$ret = $dep->checkPackageUninstall($msg, $warn, 'pkg1');
-echo 'uninstall ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-echo $warn . "\n";
-
-cleanall();
-
-$reg->addPackage("pkg2", array("name" => "pkg2", "version" => "2.0", "filelist" => $files2));
-$reg->addPackage("pkg3", array("name" => "pkg3", "version" => "3.0", "filelist" => $files3));
-
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1,
- 'release_deps' => array(
- array('type' => 'pkg', 'name' => 'pkg2', 'rel' => 'ne', 'version' => '6.0')
- )));
-
-$dep = new PEAR_Dependency($reg);
-$msg = '';
-$warn = '';
-$ret = $dep->checkPackageUninstall($msg, $warn, 'pkg2');
-echo 'uninstall ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-echo $warn . "\n";
-
-cleanall();
-
-$reg->addPackage("pkg2", array("name" => "pkg2", "version" => "2.0", "filelist" => $files2));
-$reg->addPackage("pkg3", array("name" => "pkg3", "version" => "3.0", "filelist" => $files3));
-
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1,
- 'release_deps' => array(
- array('type' => 'pkg', 'name' => 'pkg2', 'rel' => 'has')
- )));
-
-$dep = new PEAR_Dependency($reg);
-$msg = '';
-$warn = '';
-$ret = $dep->checkPackageUninstall($msg, $warn, 'pkg2');
-echo 'uninstall ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-echo $warn . "\n";
-
-cleanall();
-
-$reg->addPackage("pkg2", array("name" => "pkg2", "version" => "2.0", "filelist" => $files2));
-$reg->addPackage("pkg3", array("name" => "pkg3", "version" => "3.0", "filelist" => $files3));
-
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1,
- 'release_deps' => array(
- array('type' => 'pkg', 'name' => 'pkg2', 'rel' => 'has', 'optional' => 'no')
- )));
-
-$dep = new PEAR_Dependency($reg);
-$msg = '';
-$warn = '';
-$ret = $dep->checkPackageUninstall($msg, $warn, 'pkg2');
-echo 'uninstall ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-echo $warn . "\n";
-
-cleanall();
-
-$reg->addPackage("pkg2", array("name" => "pkg2", "version" => "2.0", "filelist" => $files2));
-$reg->addPackage("pkg3", array("name" => "pkg3", "version" => "3.0", "filelist" => $files3));
-
-$reg->addPackage("pkg1", array("name" => "pkg1", "version" => "1.0", "filelist" => $files1,
- 'release_deps' => array(
- array('type' => 'pkg', 'name' => 'pkg2', 'rel' => 'has', 'optional' => 'yes')
- )));
-
-$dep = new PEAR_Dependency($reg);
-$msg = '';
-$warn = '';
-$ret = $dep->checkPackageUninstall($msg, $warn, 'pkg2');
-echo 'uninstall ok? ';
-echo $ret ? "no\n" : "yes\n";
-echo $msg . "\n";
-echo $warn . "\n";
-
-cleanall();
-
-// ------------------------------------------------------------------------- //
-
-function cleanall()
-{
- $dp = opendir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
- while ($ent = readdir($dp)) {
- if (substr($ent, -4) == ".reg") {
- unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp' . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'checkPackagetmp');
-}
-
-?>
---GET--
---POST--
---EXPECT--
-uninstall ok? yes
-
-
-uninstall ok? yes
-
-
-uninstall ok? no
-Package 'pkg1' depends on 'pkg2'
-
-
-uninstall ok? no
-Package 'pkg1' depends on 'pkg2'
-
-
-uninstall ok? yes
-
-
-Warning: Package 'pkg1' optionally depends on 'pkg2' \ No newline at end of file
diff --git a/pear/tests/pear_downloader_invalid.phpt b/pear/tests/pear_downloader_invalid.phpt
deleted file mode 100644
index 04e41c01a9..0000000000
--- a/pear/tests/pear_downloader_invalid.phpt
+++ /dev/null
@@ -1,366 +0,0 @@
---TEST--
-PEAR_Downloader::download() invalid values test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-$server = 'pear.Chiara';
-//$server = 'test.pear.php.net';
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'cache')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'cache');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => $server,
- 'preferred_state' => 'stable',
- 'cache_dir' => $temp_path . DIRECTORY_SEPARATOR . 'cache',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Downloader.php";
-
-// no UI is needed for these tests
-$ui = false;
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-$config = &PEAR_Config::singleton();
-$options = array();
-$installer = &new PEAR_Downloader($ui, $options, $config);
-
-echo "-=-=-=-=-=-=-=-=- Failure Tests -=-=-=-=-=-=-=-=-=-=-\n";
-
-echo "Test invalid package name:\n";
-$packages = array("/invalid+packagename");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-echo "Test download of a package with no releases:\n";
-$packages = array("noreleases");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-echo "Test download of a non-existing package version:\n";
-$packages = array("pkg1-1976.9.2");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-echo "Test download of a non-existing package release state:\n";
-$packages = array("pkg1-snapshot");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-echo "Test download of invalid release state:\n";
-$packages = array("pkg1-burgerking");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-$installer->configSet('preferred_state', 'stable');
-
-echo "Test automatic version resolution (stable):\n";
-$packages = array("stabilitytoolow");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages);
-
-echo "Test automatic version resolution (stable) with --force:\n";
-$packages = array("stabilitytoolow");
-$installer->setOptions(array('force' => true));
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages[0]['info']['version']);
-
-$installer->configSet('preferred_state', 'beta');
-
-echo "Test automatic version resolution (beta):\n";
-$packages = array("stabilitytoolow");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages[0]['info']['version']);
-
-$installer->configSet('preferred_state', 'alpha');
-
-echo "Test automatic version resolution (alpha):\n";
-$packages = array("stabilitytoolow");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages[0]['info']['version']);
-
-$installer->configSet('preferred_state', 'devel');
-
-echo "Test automatic version resolution (devel):\n";
-$packages = array("stabilitytoolow");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $installpackages[0]['info']['version']);
-
-echo "Test download attempt if a version is already installed:\n";
-
-require_once 'PEAR/Installer.php';
-$install = &new PEAR_Installer($ui);
-$installer->setOptions(array());
-
-$installer->download(array('pkg6'));
-$pkgs = $installer->getDownloadedPackages();
-$install->install($pkgs[0]['file']);
-$installer->download(array('pkg6'));
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-echo "Test download attempt if a version is already installed with --force:\n";
-
-$installer->setOptions(array('force' => true));
-
-$installer->download(array('pkg6'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs(), $pkgs[0]['info']['version']);
-
-echo "Test download attempt if a version is already installed with upgrade, same version:\n";
-
-$installer->setOptions(array('upgrade' => true));
-
-$installer->download(array('pkg6'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-echo "Test download attempt if a version is already installed with upgrade, lesser version:\n";
-
-$installer->setOptions(array('upgrade' => true));
-
-$installer->download(array('pkg6-1.1'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-echo "Test download attempt with --alldeps, but dependency has no releases:\n";
-
-$installer->setOptions(array('alldeps' => true));
-
-$installer->download(array('depnoreleases'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-echo "Test download attempt with --onlyreqdeps, but dependency has no releases:\n";
-
-$installer->setOptions(array('onlyreqdeps' => true));
-
-$installer->download(array('depnoreleases'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-$installer->configSet('preferred_state', 'stable');
-echo "Test download attempt with --alldeps, but dependency is too unstable:\n";
-$installer->setOptions(array('alldeps' => true));
-
-$installer->download(array('depunstable'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-echo "Test download attempt with --onlyreqdeps, but dependency is too unstable:\n";
-
-$installer->setOptions(array('onlyreqdeps' => true));
-
-$installer->download(array('depunstable'));
-$pkgs = $installer->getDownloadedPackages();
-var_dump(get_class($a), $installer->getErrorMsgs());
-
-chdir($curdir);
-cleanall($temp_path);
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
--=-=-=-=-=-=-=-=- Failure Tests -=-=-=-=-=-=-=-=-=-=-
-Test invalid package name:
-Caught error: Package name '/invalid+packagename' not valid
-string(10) "pear_error"
-array(0) {
-}
-array(0) {
-}
-Test download of a package with no releases:
-Caught error: No releases found for package 'noreleases'
-string(10) "pear_error"
-array(0) {
-}
-array(0) {
-}
-Test download of a non-existing package version:
-Caught error: No release with version '1976.9.2' found for 'pkg1'
-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 'pkg1'
-string(10) "pear_error"
-array(0) {
-}
-array(0) {
-}
-Test download of invalid release state:
-Caught error: Invalid postfix '-burgerking', be sure to pass a valid PEAR version number or release state
-string(10) "pear_error"
-array(0) {
-}
-array(0) {
-}
-Test automatic version resolution (stable):
-Caught error: No release with state equal to: 'stable' found for 'stabilitytoolow'
-string(10) "pear_error"
-array(0) {
-}
-array(0) {
-}
-Test automatic version resolution (stable) with --force:
-Warning: stabilitytoolow is state 'devel' which is less stable than state 'stable'
-bool(false)
-array(0) {
-}
-string(6) "3.0dev"
-Test automatic version resolution (beta):
-bool(false)
-array(0) {
-}
-string(5) "1.0b1"
-Test automatic version resolution (alpha):
-bool(false)
-array(0) {
-}
-string(5) "2.0a1"
-Test automatic version resolution (devel):
-bool(false)
-array(0) {
-}
-string(6) "3.0dev"
-Test download attempt if a version is already installed:
-Package 'pkg6' already installed, skipping
-bool(false)
-array(0) {
-}
-Test download attempt if a version is already installed with --force:
-bool(false)
-array(0) {
-}
-string(5) "2.0b1"
-Test download attempt if a version is already installed with upgrade, same version:
-Package 'pkg6-2.0b1' already installed, skipping
-bool(false)
-array(0) {
-}
-Test download attempt if a version is already installed with upgrade, lesser version:
-Package 'pkg6' version '2.0b1' is installed and 2.0b1 is > requested '1.1', skipping
-bool(false)
-array(0) {
-}
-Test download attempt with --alldeps, but dependency has no releases:
-bool(false)
-array(1) {
- [0]=>
- string(63) "Package 'depnoreleases' dependency 'noreleases' has no releases"
-}
-Test download attempt with --onlyreqdeps, but dependency has no releases:
-bool(false)
-array(1) {
- [0]=>
- string(63) "Package 'depnoreleases' dependency 'noreleases' has no releases"
-}
-Test download attempt with --alldeps, but dependency is too unstable:
-bool(false)
-array(1) {
- [0]=>
- string(91) "Release for 'depunstable' dependency 'stabilitytoolow' has state 'devel', requires 'stable'"
-}
-Test download attempt with --onlyreqdeps, but dependency is too unstable:
-bool(false)
-array(1) {
- [0]=>
- string(91) "Release for 'depunstable' dependency 'stabilitytoolow' has state 'devel', requires 'stable'"
-} \ No newline at end of file
diff --git a/pear/tests/pear_downloader_new.phpt b/pear/tests/pear_downloader_new.phpt
deleted file mode 100644
index 4d6e8c78f5..0000000000
--- a/pear/tests/pear_downloader_new.phpt
+++ /dev/null
@@ -1,570 +0,0 @@
---TEST--
-PEAR_Downloader::download() test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-$server = 'pear.Chiara';
-//$server = 'test.pear.php.net';
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'cache')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'cache');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => $server,
- 'preferred_state' => 'stable',
- 'cache_dir' => $temp_path . DIRECTORY_SEPARATOR . 'cache',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Downloader.php";
-
-// no UI is needed for these tests
-$ui = false;
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-echo "Test simple direct url download:\n";
-
-$config = &PEAR_Config::singleton();
-$packages = array("http://$server/get/pkg6-1.1.tgz");
-$options = array();
-$installer = &new PEAR_Downloader($ui, $options, $config);
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-var_dump($installpackages);
-
-echo "Test simple package name download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6');
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-var_dump($installpackages);
-
-echo "Test package name with version download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-1.1');
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "Test package name with state stable download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-stable');
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "Test package name with state beta download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-beta');
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-2.0b1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "================\nTest preferred_state = beta\n";
-$installer->configSet('preferred_state', 'beta');
-
-echo "Test simple package name download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6');
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-2.0b1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-
-echo "\n================Test --alldeps\nTest preferred_state = stable\n";
-$installer->configSet('preferred_state', 'stable');
-
-$installer = &new PEAR_Downloader($ui, array('alldeps' => true), $config);
-$packages = array("http://$server/get/pkg1-1.1.tgz");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-
-echo "Test preferred_state = beta:\n";
-$installer->configSet('preferred_state', 'beta');
-
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-
-echo "Test preferred_state = alpha:\n";
-$installer->configSet('preferred_state', 'alpha');
-
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-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');
-
-$installer = &new PEAR_Downloader($ui, array('onlyreqdeps' => true), $config);
-$packages = array("http://$server/get/pkg1-1.1.tgz");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-
-echo "Test preferred_state = beta:\n";
-$installer->configSet('preferred_state', 'beta');
-
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-
-echo "Test preferred_state = alpha:\n";
-$installer->configSet('preferred_state', 'alpha');
-
-$packages = array("pkg1");
-$a = $installer->download($packages);
-$installpackages = $installer->getDownloadedPackages();
-var_dump($a, $installer->getErrorMsgs());
-echo "Packages downloaded and version:\n";
-foreach ($installpackages as $package) {
- echo $package['pkg'] . '-' . $package['info']['version'] . "\n";
-}
-
-
-chdir($curdir);
-cleanall($temp_path);
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-Test simple direct url download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-array(1) {
- [0]=>
- array(2) {
- ["pkg"]=>
- string(4) "pkg6"
- ["info"]=>
- array(11) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(3) {
- ["zoorb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\oggbrzitzkee.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\Mopreeb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- }
- ["package"]=>
- string(4) "pkg6"
- ["summary"]=>
- string(32) "required test for PEAR_Installer"
- ["description"]=>
- string(12) "fake package"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(8) "fakeuser"
- ["name"]=>
- string(9) "Joe Shmoe"
- ["email"]=>
- string(18) "nobody@example.com"
- ["role"]=>
- string(4) "lead"
- }
- }
- ["version"]=>
- string(3) "1.1"
- ["release_date"]=>
- string(10) "2003-09-09"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(6) "stable"
- ["release_notes"]=>
- string(24) "required dependency test"
- }
- }
-}
-Test simple package name download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-array(1) {
- [0]=>
- array(2) {
- ["pkg"]=>
- string(4) "pkg6"
- ["info"]=>
- array(11) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(3) {
- ["zoorb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\oggbrzitzkee.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\Mopreeb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- }
- ["package"]=>
- string(4) "pkg6"
- ["summary"]=>
- string(32) "required test for PEAR_Installer"
- ["description"]=>
- string(12) "fake package"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(8) "fakeuser"
- ["name"]=>
- string(9) "Joe Shmoe"
- ["email"]=>
- string(18) "nobody@example.com"
- ["role"]=>
- string(4) "lead"
- }
- }
- ["version"]=>
- string(3) "1.1"
- ["release_date"]=>
- string(10) "2003-09-09"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(6) "stable"
- ["release_notes"]=>
- string(24) "required dependency test"
- }
- }
-}
-Test package name with version download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-Test package name with state stable download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-Test package name with state beta download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-================
-Test preferred_state = beta
-Test simple package name download:
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-
-================Test --alldeps
-Test preferred_state = stable
-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
-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:
-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:
-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
-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
-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:
-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'
-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
diff --git a/pear/tests/pear_downloader_old.phpt b/pear/tests/pear_downloader_old.phpt
deleted file mode 100644
index 381dfca9da..0000000000
--- a/pear/tests/pear_downloader_old.phpt
+++ /dev/null
@@ -1,598 +0,0 @@
---TEST--
-PEAR_Installer test: PEAR_Installer::download() (deprecated)
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-$server = 'pear.Chiara';
-//$server = 'test.pear.php.net';
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'cache')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'cache');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => $server,
- 'preferred_state' => 'stable',
- 'cache_dir' => $temp_path . DIRECTORY_SEPARATOR . 'cache',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Installer.php";
-
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-set_error_handler('catchphp');
-
-function catchphp($errno, $errmsg)
-{
- if (error_reporting() == 0) {
- return;
- }
- $errlevel = array(
- E_USER_NOTICE => 'Notice',
- E_USER_WARNING => 'Warning',
- E_USER_ERROR => 'Error',
- E_WARNING => 'Warning',
- E_NOTICE => 'Notice'
- );
- echo $errlevel[$errno] . ': ' . $errmsg . "\n";
-}
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-echo "Test simple direct url download:\n";
-
-$config = &PEAR_Config::singleton();
-$packages = array("http://$server/get/pkg6-1.1.tgz");
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-var_dump($installpackages);
-
-echo "Test simple package name download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6');
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-var_dump($installpackages);
-
-echo "Test package name with version download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-1.1');
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "Test package name with state stable download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-stable');
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "Test package name with state beta download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6-beta');
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-2.0b1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-
-echo "================\nTest preferred_state = beta\n";
-$config->set('preferred_state', 'beta');
-
-echo "Test simple package name download:\n";
-$installpackages = $errors = array();
-$packages = array('pkg6');
-$a = $installer->download($packages, array(), &$config, &$installpackages, &$errors);
-var_dump($a, $errors);
-
-echo "File exists? ";
-echo (is_file($installpackages[0]['file'])) ? "yes\n" : "no\n";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-2.0b1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);
-
-echo "\n================Test --alldeps\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('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";
-}
-$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";
-echo "File is the same? ";
-$good = implode('', file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz'));
-$dled = implode('', file($installpackages[0]['file']));
-echo ($good == $dled) ? "yes\n" : "no\n";
-unlink($installpackages[0]['file']);
-unset($installpackages[0]['file']);*/
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-Test simple direct url download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-array(1) {
- [0]=>
- array(2) {
- ["pkg"]=>
- string(4) "pkg6"
- ["info"]=>
- array(11) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(3) {
- ["zoorb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\oggbrzitzkee.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\Mopreeb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- }
- ["package"]=>
- string(4) "pkg6"
- ["summary"]=>
- string(32) "required test for PEAR_Installer"
- ["description"]=>
- string(12) "fake package"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(8) "fakeuser"
- ["name"]=>
- string(9) "Joe Shmoe"
- ["email"]=>
- string(18) "nobody@example.com"
- ["role"]=>
- string(4) "lead"
- }
- }
- ["version"]=>
- string(3) "1.1"
- ["release_date"]=>
- string(10) "2003-09-09"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(6) "stable"
- ["release_notes"]=>
- string(24) "required dependency test"
- }
- }
-}
-Test simple package name download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-array(1) {
- [0]=>
- array(2) {
- ["pkg"]=>
- string(4) "pkg6"
- ["info"]=>
- array(11) {
- ["provides"]=>
- array(0) {
- }
- ["filelist"]=>
- &array(3) {
- ["zoorb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\oggbrzitzkee.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- ["goompness\Mopreeb.php"]=>
- array(2) {
- ["role"]=>
- string(3) "php"
- ["baseinstalldir"]=>
- string(5) "groob"
- }
- }
- ["package"]=>
- string(4) "pkg6"
- ["summary"]=>
- string(32) "required test for PEAR_Installer"
- ["description"]=>
- string(12) "fake package"
- ["maintainers"]=>
- array(1) {
- [0]=>
- &array(4) {
- ["handle"]=>
- string(8) "fakeuser"
- ["name"]=>
- string(9) "Joe Shmoe"
- ["email"]=>
- string(18) "nobody@example.com"
- ["role"]=>
- string(4) "lead"
- }
- }
- ["version"]=>
- string(3) "1.1"
- ["release_date"]=>
- string(10) "2003-09-09"
- ["release_license"]=>
- string(11) "PHP License"
- ["release_state"]=>
- string(6) "stable"
- ["release_notes"]=>
- string(24) "required dependency test"
- }
- }
-}
-Test package name with version download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-Test package name with state stable download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-Test package name with state beta download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-================
-Test preferred_state = beta
-Test simple package name download:
-Warning: PEAR Warning: PEAR_Installer::download() is deprecated in favor of PEAR_Downloader class
-NULL
-array(0) {
-}
-File exists? yes
-File is the same? yes
-
-================Test --alldeps
-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:
-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
diff --git a/pear/tests/pear_installer1.phpt b/pear/tests/pear_installer1.phpt
deleted file mode 100644
index 90c710cba7..0000000000
--- a/pear/tests/pear_installer1.phpt
+++ /dev/null
@@ -1,104 +0,0 @@
---TEST--
-PEAR_Installer test #1
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-
-require_once "PEAR/Installer.php";
-
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-touch($temp_path . DIRECTORY_SEPARATOR . 'user.conf');
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-echo "test extractDownloadFileName:\n";
-echo 'existing file: ';
-echo ($temp_path . DIRECTORY_SEPARATOR . 'user.conf' ==
- $installer->extractDownloadFileName($temp_path . DIRECTORY_SEPARATOR . 'user.conf',
- $ui)) ? "yes\n" : "no\n";
-var_dump($ui);
-echo 'invalid match: ';
-echo $installer->extractDownloadFileName('27',
- $ui);
-echo "\n";
-var_dump($ui);
-echo 'valid match, no version: ';
-echo $installer->extractDownloadFileName('Testpackage', $ui);
-echo "\n";
-var_dump($ui);
-echo 'invalid match, has invalid version: ';
-echo $installer->extractDownloadFileName('Testpackage-##', $ui);
-echo "\n";
-var_dump($ui);
-echo 'valid match, has version: ';
-echo $installer->extractDownloadFileName('Testpackage-1.2', $ui);
-echo "\n";
-var_dump($ui);
-
-echo "\ntest checkDeps 1:\n";
-$fakerel = array('release_deps' =>
-array(
- array(
- 'type' => 'pkg',
- 'rel '=> 'has',
- 'name' => 'foo',
- 'optional' => 'yes'
- ),
- array(
- 'type' => 'pkg',
- 'rel '=> 'ge',
- 'version' => '1.6',
- 'name' => 'bar',
- ),
-));
-$res = '';
-var_dump($installer->checkDeps($fakerel, $res));
-var_dump($res);
-$fakerel = array('release_deps' =>
-array(
- array(
- 'type' => 'pkg',
- 'rel '=> 'has',
- 'name' => 'foo',
- 'optional' => 'yes'
- ),
-));
-echo "\ntest checkDeps 2:\n";
-$res = '';
-var_dump($installer->checkDeps($fakerel, $res));
-var_dump($res);
-unlink($temp_path . DIRECTORY_SEPARATOR . 'user.conf');
-rmdir($temp_path);
-?>
---GET--
---POST--
---EXPECT--
-test extractDownloadFileName:
-existing file: yes
-bool(false)
-invalid match: 27
-NULL
-valid match, no version: Testpackage
-NULL
-invalid match, has invalid version: Testpackage-##
-NULL
-valid match, has version: Testpackage
-string(3) "1.2"
-
-test checkDeps 1:
-bool(true)
-string(23) "
-requires package `bar'"
-
-test checkDeps 2:
-bool(false)
-string(77) "Optional dependencies:
-package `foo' is recommended to utilize some features."
diff --git a/pear/tests/pear_installer2.phpt b/pear/tests/pear_installer2.phpt
deleted file mode 100644
index daee603cdd..0000000000
--- a/pear/tests/pear_installer2.phpt
+++ /dev/null
@@ -1,399 +0,0 @@
---TEST--
-PEAR_Installer test #2
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Installer.php";
-
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-echo "test _installFile():\n";
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php', 'w');
-fwrite($fp, 'a');
-fclose($fp);
-// pretend we just parsed a package.xml
-$installer->pkginfo = array('package' => 'Foo');
-
-echo "install as role=\"php\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'php'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file ext/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install as role=\"ext\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'ext'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file php/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'ext' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install as role=\"data\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'data'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file data/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR .
- 'Foo' . DIRECTORY_SEPARATOR . '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install as role=\"doc\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'doc'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file doc/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'doc' . DIRECTORY_SEPARATOR .
- 'Foo' . DIRECTORY_SEPARATOR . '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install as role=\"test\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'test'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file test/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR .
- 'Foo' . DIRECTORY_SEPARATOR . '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install as role=\"script\":\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-$installer->rollbackFileTransaction();
-
-echo "install as invalid role=\"klingon\":\n";
-$err = $installer->_installFile('installer2.phpt.testfile.php', array('role' => 'klingon'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array());
-echo 'returned PEAR_Error: ' . (get_class($err) == 'pear_error' ? "yes\n" : "no\n");
-if (is_object($err)) {
- echo 'message: ' . $err->getMessage() . "\n\n";
-}
-echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "install non-existent file:\n";
-$err = $installer->_installFile('....php', array('role' => 'php'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array());
-echo 'returned PEAR_Error: ' . (get_class($err) == 'pear_error' ? "yes\n" : "no\n");
-if (is_object($err)) {
- echo 'message: ' . $err->getMessage() . "\n";
-}
-echo 'file bin/.tmp....php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmp....php') ? "yes\n" : "no\n");
-
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php', 'w');
-fwrite($fp, '@TEST@ stuff');
-fclose($fp);
-
-echo "\ntest valid md5sum:\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script', 'md5sum' => md5('@TEST@ stuff')),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-$installer->rollbackFileTransaction();
-
-echo "test invalid md5sum:\n";
-$err = $installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script', 'md5sum' => md5('oops stuff')),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array());
-echo 'returned PEAR_Error: ' . (get_class($err) == 'pear_error' ? "yes\n" : "no\n");
-if (is_object($err)) {
- echo 'message: ' . ($err->getMessage() == 'bad md5sum for file ' . $temp_path . DIRECTORY_SEPARATOR . 'bin' .
- DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php' ? 'match' : 'no match') . "\n";
-}
-echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-echo "test invalid md5sum with --force:\n";
-ob_start();
-$err = $installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script', 'md5sum' => md5('oops stuff')),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array('force' => true));
-$warning = ob_get_contents();
-ob_end_clean();
-echo 'warning : ';
-echo ($warning == 'warning : bad md5sum for file ' . $temp_path . DIRECTORY_SEPARATOR . 'bin' .
- DIRECTORY_SEPARATOR . "installer2.phpt.testfile.php\n" ? "match\n" : "no match\n");
-echo 'returned PEAR_Error: ' . (get_class($err) == 'pear_error' ? "yes\n" : "no\n");
-if (is_object($err)) {
- echo 'message: ' . ($err->getMessage() == 'bad md5sum for file ' . $temp_path . DIRECTORY_SEPARATOR . 'bin' .
- DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php' ? 'match' : 'no match') . "\n";
-}
-echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => ';
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n");
-
-define('PEARINSTALLERTEST2_FAKE_FOO_CONST', 'good');
-echo "\ntest replacements:\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'php-const', 'from' => '@TEST@', 'to' => 'PEARINSTALLERTEST2_FAKE_FOO_CONST'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo "==>test php-const replacement: equals 'good stuff'? => ";
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-$installer->rollbackFileTransaction();
-
-echo "==>test invalid php-const replacement:\n";
-$err = $installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'php-const', 'from' => '@TEST@', 'to' => '%PEARINSTALLERTEST2_FAKE_FOO_CONST'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array());
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-
-$installer->rollbackFileTransaction();
-
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'pear-config', 'from' => '@TEST@', 'to' => 'master_server'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo "==>test pear-config replacement: equals 'pear.php.net stuff'? => ";
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-$installer->rollbackFileTransaction();
-
-echo "==>test invalid pear-config replacement\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'pear-config', 'from' => '@TEST@', 'to' => 'blahblahblah'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-$installer->rollbackFileTransaction();
-
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'package-info', 'from' => '@TEST@', 'to' => 'package'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo "==>test package-info replacement: equals 'Foo stuff'? => ";
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-$installer->rollbackFileTransaction();
-
-echo "==>test invalid package-info replacement:\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'replacements' => array(array('type' => 'package-info', 'from' => '@TEST@', 'to' => 'gronk'))),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'))
-{
- $a = implode(file($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpinstaller2.phpt.testfile.php'), '');
- echo "$a\n";
-} else {
- echo "no! file installation failed\n";
-}
-$installer->rollbackFileTransaction();
-
-echo "\ntest install-as:\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'install-as' => 'foobar.php'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo "==>test install as 'foobar.php'. file exists? ";
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- '.tmpfoobar.php'))
-{
- echo "yes\n";
-} else {
- echo "no\n";
-}
-$installer->rollbackFileTransaction();
-
-echo "\ntest baseinstalldir:\n";
-var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script',
- 'baseinstalldir' => 'Foo/Mine'),
- $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()));
-echo "==>test baseinstalldir = 'Foo/Mine'. file exists? ";
-if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- 'Foo' . DIRECTORY_SEPARATOR . 'Mine' . DIRECTORY_SEPARATOR . '.tmpinstaller2.phpt.testfile.php'))
-{
- echo "yes\n";
-} else {
- echo "no\n";
-}
-$installer->rollbackFileTransaction();
-
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- 'Foo' . DIRECTORY_SEPARATOR . 'Mine');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR .
- 'Foo');
-unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php');
-//cleanup
-chdir($curdir);
-unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'Foo');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'doc' . DIRECTORY_SEPARATOR . 'Foo');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'Foo');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-rmdir($temp_path);
-?>
---GET--
---POST--
---EXPECT--
-test _installFile():
-install as role="php":
-int(1)
-file ext/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as role="ext":
-int(1)
-file php/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as role="data":
-int(1)
-file data/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as role="doc":
-int(1)
-file doc/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as role="test":
-int(1)
-file test/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as role="script":
-int(1)
-file bin/.tmpinstaller2.phpt.testfile.php exists? => yes
-install as invalid role="klingon":
-returned PEAR_Error: yes
-message: Invalid role `klingon' for file installer2.phpt.testfile.php
-
-file bin/.tmpinstaller2.phpt.testfile.php exists? => no
-install non-existent file:
-returned PEAR_Error: yes
-message: file does not exist
-file bin/.tmp....php exists? => no
-
-test valid md5sum:
-int(1)
-file bin/.tmpinstaller2.phpt.testfile.php exists? => yes
-test invalid md5sum:
-returned PEAR_Error: yes
-message: match
-file bin/.tmpinstaller2.phpt.testfile.php exists? => no
-test invalid md5sum with --force:
-warning : match
-returned PEAR_Error: no
-file bin/.tmpinstaller2.phpt.testfile.php exists? => yes
-
-test replacements:
-int(1)
-==>test php-const replacement: equals 'good stuff'? => good stuff
-==>test invalid php-const replacement:
-invalid php-const replacement: %PEARINSTALLERTEST2_FAKE_FOO_CONST
-@TEST@ stuff
-int(1)
-==>test pear-config replacement: equals 'pear.php.net stuff'? => pear.php.net stuff
-==>test invalid pear-config replacement
-invalid pear-config replacement: blahblahblah
-int(1)
-@TEST@ stuff
-int(1)
-==>test package-info replacement: equals 'Foo stuff'? => Foo stuff
-==>test invalid package-info replacement:
-invalid package-info replacement: gronk
-int(1)
-@TEST@ stuff
-
-test install-as:
-int(1)
-==>test install as 'foobar.php'. file exists? yes
-
-test baseinstalldir:
-int(1)
-==>test baseinstalldir = 'Foo/Mine'. file exists? yes
-
diff --git a/pear/tests/pear_installer3.phpt b/pear/tests/pear_installer3.phpt
deleted file mode 100644
index d40f1fdd14..0000000000
--- a/pear/tests/pear_installer3.phpt
+++ /dev/null
@@ -1,417 +0,0 @@
---TEST--
-PEAR_Installer test #3 File Transactions
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Installer.php";
-
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-$installer->debug = 2; // hack debugging in
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-echo "test addFileOperation():\n";
-echo "invalid input to addFileOperation():\n";
-$err = $installer->addFileOperation('rename', 2);
-echo 'Returned PEAR_Error?';
-echo (get_class($err) == 'pear_error' ? " yes\n" : " no\n");
-if (get_class($err) == 'pear_error') {
- echo $err->getMessage() . "\n";
-}
-echo 'count($installer->file_operations) = ';
-var_dump(count($installer->file_operations));
-echo "Do valid addFileOperation() delete\n";
-touch($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt');
-$installer->addFileOperation('delete', array($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt'));
-echo 'count($installer->file_operations) = ';
-var_dump(count($installer->file_operations));
-
-echo "test valid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
-}
-
-echo "Do valid addFileOperation() rename\n";
-touch($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt');
-$installer->addFileOperation('rename', array($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt', $temp_path .
- DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'renamed.phpt'));
-
-echo 'file renamed.phpt exists?';
-clearstatcache();
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
- . 'renamed.phpt') ? " yes\n" : " no\n");
-echo "test valid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
-}
-echo 'file renamed.phpt exists?';
-clearstatcache();
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
- . 'renamed.phpt') ? " yes\n" : " no\n");
-unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
- . 'renamed.phpt');
-
-echo "Do valid addFileOperation() chmod\n";
-touch($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt');
-clearstatcache();
-$perms = fileperms($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt');
-// check to see if chmod works on this OS
-chmod($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt', 0776);
-clearstatcache();
-if (fileperms($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt')
- == $perms && substr(PHP_OS, 0, 3) == 'WIN') {
- // we are on windows, so skip this test, but simulate success
-echo <<<EOF
-file permissions are: 776
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-file permissions are: 640
-
-EOF;
-} else {
- $installer->addFileOperation('chmod', array(0640, $temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt'));
-
- echo 'file permissions are: ' . decoct(fileperms($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt')) . "\n";
- echo "test valid commitFileTransaction():\n";
- if ($installer->commitFileTransaction()) {
- echo "worked\n";
- } else {
- echo "didn't work!\n";
- }
- echo 'file permissions are: ' . decoct(fileperms($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah.phpt')) . "\n";
-}
-unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah.phpt');
-
-mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah');
-echo "Do valid addFileOperation() rmdir\n";
-echo 'directory exists?';
-clearstatcache();
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah') ? " yes\n" : " no\n");
-$installer->addFileOperation('rmdir', array($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah'));
-
-echo "test valid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
-}
-echo 'directory exists?';
-
-clearstatcache();
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR .
- 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah') ? " yes\n" : " no\n");
-
-echo "Do valid addFileOperation() installed_as\n";
-$installer->addFileOperation('installed_as', array('test.php',
- $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah.phpt',
- $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR,
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp'));
-echo "test valid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
-}
-if (isset($installer->pkginfo['filelist'])) {
- echo "filelist created\n";
-} else {
- echo "filelist not created!\n";
-}
-if (isset($installer->pkginfo['filelist']['test.php'])) {
- echo "filelist test.php created\n";
-} else {
- echo "filelist test.php not created!\n";
-}
-if (isset($installer->pkginfo['filelist']['test.php']['installed_as'])) {
- echo "filelist test.php installed_as created\n";
-} else {
- echo "filelist test.php installed_as not created!\n";
-}
-$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah.phpt';
-if (@$installer->pkginfo['filelist']['test.php']['installed_as'] == $p) {
- echo "filelist test.php installed_as is correct\n";
-} else {
- echo "filelist test.php installed_as is not correct!\n";
-}
-if (isset($installer->pkginfo['filelist']['dirtree'])) {
- echo "filelist dirtree created\n";
-} else {
- echo "filelist dirtree not created!\n";
-}
-$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp';
-if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
- echo "filelist dirtree glomp created\n";
-} else {
- echo "filelist dirtree glomp not created!\n";
-}
-$p .= DIRECTORY_SEPARATOR . 'fromp';
-if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
- echo "filelist dirtree fromp created\n";
-} else {
- echo "filelist dirtree fromp not created!\n";
-}
-
-echo "Do valid addFileOperation() installed_as\n";
-$installer->addFileOperation('installed_as', array('test.php',
- $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah.phpt',
- $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR,
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp'));
-echo "test valid rollbackFileTransaction():\n";
-$installer->rollbackFileTransaction();
-if (isset($installer->pkginfo['filelist'])) {
- echo "filelist created\n";
-} else {
- echo "filelist not created!\n";
-}
-if (isset($installer->pkginfo['filelist']['test.php'])) {
- echo "filelist test.php created\n";
-} else {
- echo "filelist test.php not created!\n";
-}
-if (isset($installer->pkginfo['filelist']['test.php']['installed_as'])) {
- echo "filelist test.php installed_as created\n";
-} else {
- echo "filelist test.php installed_as not created!\n";
-}
-$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
- . 'installertestfooblah.phpt';
-if (@$installer->pkginfo['filelist']['test.php']['installed_as'] == $p) {
- echo "filelist test.php installed_as is correct\n";
-} else {
- echo "filelist test.php installed_as is not correct!\n";
-}
-if (isset($installer->pkginfo['filelist']['dirtree'])) {
- echo "filelist dirtree created\n";
-} else {
- echo "filelist dirtree not created!\n";
-}
-$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
- 'glomp';
-if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
- echo "filelist dirtree glomp created\n";
-} else {
- echo "filelist dirtree glomp not created!\n";
-}
-$p .= DIRECTORY_SEPARATOR . 'fromp';
-if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
- echo "filelist dirtree fromp created\n";
-} else {
- echo "filelist dirtree fromp not created!\n";
-}
-
-// invalid tests
-echo "\n==>Invalid tests\n";
-echo "Do valid addFileOperation() delete with non-existing file\n";
-$installer->addFileOperation('delete', array('gloober62456.phpt'));
-echo 'count($installer->file_operations) = ';
-var_dump(count($installer->file_operations));
-
-echo "test invalid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
- $installer->rollbackFileTransaction();
-}
-
-echo "Do valid addFileOperation() rename with non-existing file\n";
-$installer->addFileOperation('rename', array('gloober62456.phpt', 'faber.com'));
-echo 'count($installer->file_operations) = ';
-var_dump(count($installer->file_operations));
-
-echo "test invalid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
- $installer->rollbackFileTransaction();
-}
-
-echo "Do valid addFileOperation() chmod with non-existing file\n";
-$installer->addFileOperation('chmod', array(0640, 'faber.com'));
-echo 'count($installer->file_operations) = ';
-var_dump(count($installer->file_operations));
-
-echo "test invalid commitFileTransaction():\n";
-if ($installer->commitFileTransaction()) {
- echo "worked\n";
-} else {
- echo "didn't work!\n";
- $installer->rollbackFileTransaction();
-}
-
-//cleanup
-chdir($curdir);
-unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-unlink ($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-rmdir($temp_path);
-?>
---GET--
---POST--
---EXPECT--
-test addFileOperation():
-invalid input to addFileOperation():
-Returned PEAR_Error? yes
-Internal Error: $data in addFileOperation must be an array, was integer
-count($installer->file_operations) = int(0)
-Do valid addFileOperation() delete
-count($installer->file_operations) = int(1)
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-Do valid addFileOperation() rename
-file renamed.phpt exists? no
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-file renamed.phpt exists? yes
-Do valid addFileOperation() chmod
-file permissions are: 776
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-file permissions are: 640
-Do valid addFileOperation() rmdir
-directory exists? yes
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-directory exists? no
-Do valid addFileOperation() installed_as
-test valid commitFileTransaction():
-about to commit 1 file operations
-successfully committed 1 file operations
-worked
-filelist created
-filelist test.php created
-filelist test.php installed_as created
-filelist test.php installed_as is correct
-filelist dirtree created
-filelist dirtree glomp created
-filelist dirtree fromp created
-Do valid addFileOperation() installed_as
-test valid rollbackFileTransaction():
-rolling back 1 file operations
-filelist created
-filelist test.php created
-filelist test.php installed_as not created!
-filelist test.php installed_as is not correct!
-filelist dirtree not created!
-filelist dirtree glomp not created!
-filelist dirtree fromp not created!
-
-==>Invalid tests
-Do valid addFileOperation() delete with non-existing file
-count($installer->file_operations) = int(1)
-test invalid commitFileTransaction():
-about to commit 1 file operations
-warning: file gloober62456.phpt doesn't exist, can't be deleted
-successfully committed 1 file operations
-worked
-Do valid addFileOperation() rename with non-existing file
-count($installer->file_operations) = int(1)
-test invalid commitFileTransaction():
-about to commit 1 file operations
-cannot rename file gloober62456.phpt, doesn't exist
-didn't work!
-rolling back 1 file operations
-Do valid addFileOperation() chmod with non-existing file
-count($installer->file_operations) = int(1)
-test invalid commitFileTransaction():
-about to commit 1 file operations
-permission denied (chmod): faber.com 640
-didn't work!
-rolling back 1 file operations
diff --git a/pear/tests/pear_installer4.phpt b/pear/tests/pear_installer4.phpt
deleted file mode 100644
index c9af6c43b0..0000000000
--- a/pear/tests/pear_installer4.phpt
+++ /dev/null
@@ -1,259 +0,0 @@
---TEST--
-PEAR_Installer test #4: PEAR_Installer::install()
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Installer.php";
-
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-echo "Test package.xml direct install:\n";
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'package.xml');
-$reg = &new PEAR_Registry($temp_path . DIRECTORY_SEPARATOR . 'php');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-echo "After uninstall:\n";
-$installer->uninstall('pkg6');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-echo "goompness exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'))
- ? "yes\n" : "no\n";
-
-echo "Test .tgz install:\n";
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'pkg6-1.1.tgz');
-$reg = &new PEAR_Registry($temp_path . DIRECTORY_SEPARATOR . 'php');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-echo "After uninstall:\n";
-$installer->uninstall('pkg6');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-echo "goompness exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'))
- ? "yes\n" : "no\n";
-
-echo "Test invalid .tgz install:\n";
-$error_to_catch = 'unable to unpack ' . dirname(__FILE__) . DIRECTORY_SEPARATOR .
- 'test-pkg6' . DIRECTORY_SEPARATOR . 'invalidtgz.tgz';
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'invalidtgz.tgz');
-$reg = &new PEAR_Registry($temp_path . DIRECTORY_SEPARATOR . 'php');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-
-echo "Test missing package.xml in .tgz install:\n";
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test-pkg6' . DIRECTORY_SEPARATOR . 'nopackagexml.tgz');
-$reg = &new PEAR_Registry($temp_path . DIRECTORY_SEPARATOR . 'php');
-var_dump($reg->listPackages());
-echo "zoorb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'zoorb.php')) ? "yes\n" : "no\n";
-echo "goompness/Mopreeb.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'Mopreeb.php')) ? "yes\n" : "no\n";
-echo "goompness/oggbrzitzkee.php exists? ";
-echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'groob' . DIRECTORY_SEPARATOR . 'goompness'
- . DIRECTORY_SEPARATOR . 'oggbrzitzkee.php')) ? "yes\n" : "no\n";
-
-chdir($curdir);
-cleanall($temp_path);
-
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-Test package.xml direct install:
-array(1) {
- [0]=>
- string(4) "pkg6"
-}
-zoorb.php exists? yes
-goompness/Mopreeb.php exists? yes
-goompness/oggbrzitzkee.php exists? yes
-After uninstall:
-array(0) {
-}
-zoorb.php exists? no
-goompness/Mopreeb.php exists? no
-goompness/oggbrzitzkee.php exists? no
-goompness exists? no
-Test .tgz install:
-array(1) {
- [0]=>
- string(4) "pkg6"
-}
-zoorb.php exists? yes
-goompness/Mopreeb.php exists? yes
-goompness/oggbrzitzkee.php exists? yes
-After uninstall:
-array(0) {
-}
-zoorb.php exists? no
-goompness/Mopreeb.php exists? no
-goompness/oggbrzitzkee.php exists? no
-goompness exists? no
-Test invalid .tgz install:
-Caught error: Invalid checksum for file "<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/" : 37649 calculated, 0 expected
-Caught expected error
-array(0) {
-}
-zoorb.php exists? no
-goompness/Mopreeb.php exists? no
-goompness/oggbrzitzkee.php exists? no
-Test missing package.xml in .tgz install:
-warning : you are using an archive with an old format
-Caught error: no package.xml file after extracting the archive
-array(0) {
-}
-zoorb.php exists? no
-goompness/Mopreeb.php exists? no
-goompness/oggbrzitzkee.php exists? no
diff --git a/pear/tests/pear_installer5.phpt b/pear/tests/pear_installer5.phpt
deleted file mode 100644
index 77415b9641..0000000000
--- a/pear/tests/pear_installer5.phpt
+++ /dev/null
@@ -1,226 +0,0 @@
---TEST--
-PEAR_Installer test #5: test directory tracking/deletion of installation
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Installer.php";
-
-// no UI is needed for these tests
-$ui = false;
-$installer = new PEAR_Installer($ui);
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' . DIRECTORY_SEPARATOR . 'package.xml');
-$installer->install(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' . DIRECTORY_SEPARATOR . 'package2.xml');
-$reg = &new PEAR_Registry($temp_path . DIRECTORY_SEPARATOR . 'php');
-var_dump($reg->listPackages());
-$info = $reg->packageInfo('pkg1');
-echo "pkg1 dir tree contains test/? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test'])) ? "yes\n" : "no\n";
-echo "pkg1 dir tree contains test/multiplepackages? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'multiplepackages'])) ? "yes\n" : "no\n";
-echo "pkg1 dir tree contains test/pkg1? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'pkg1'])) ? "yes\n" : "no\n";
-
-$info = $reg->packageInfo('pkg2');
-echo "pkg2 dir tree contains test/? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test'])) ? "yes\n" : "no\n";
-echo "pkg2 dir tree contains test/multiplepackages? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'multiplepackages'])) ? "yes\n" : "no\n";
-echo "pkg2 dir tree contains test/nestedroot? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'])) ? "yes\n" : "no\n";
-echo "pkg2 dir tree contains test/nestedroot/emptydir? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir'])) ? "yes\n" : "no\n";
-echo "pkg2 dir tree contains test/nestedroot/emptydir/nesteddir? ";
-echo (isset($info['filelist']['dirtree'][$temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir' . DIRECTORY_SEPARATOR . 'nesteddir'])) ? "yes\n" : "no\n";
-
-echo "After uninstall of pkg1:\n";
-$installer->uninstall('pkg1');
-echo "test/ exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test')) ? "yes\n" : "no\n";
-echo "test/multiplepackages exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'multiplepackages')) ? "yes\n" : "no\n";
-echo "test/pkg1 exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'pkg1')) ? "yes\n" : "no\n";
-echo "test/nestedroot exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot')) ? "yes\n" : "no\n";
-echo "test/nestedroot/emptydir exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir')) ? "yes\n" : "no\n";
-echo "test/nestedroot/emptydir/nesteddir exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir'. DIRECTORY_SEPARATOR . 'nesteddir')) ? "yes\n" : "no\n";
-var_dump($reg->listPackages());
-
-echo "After uninstall of pkg2:\n";
-$installer->uninstall('pkg2');
-echo "test/ exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test')) ? "yes\n" : "no\n";
-echo "test/multiplepackages exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'multiplepackages')) ? "yes\n" : "no\n";
-echo "test/pkg1 exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'pkg1')) ? "yes\n" : "no\n";
-echo "test/nestedroot exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot')) ? "yes\n" : "no\n";
-echo "test/nestedroot/emptydir exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir')) ? "yes\n" : "no\n";
-echo "test/nestedroot/emptydir/nesteddir exists? ";
-echo (is_dir($temp_path . DIRECTORY_SEPARATOR . 'php'
- . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'nestedroot'
- . DIRECTORY_SEPARATOR . 'emptydir'. DIRECTORY_SEPARATOR . 'nesteddir')) ? "yes\n" : "no\n";
-var_dump($reg->listPackages());
-
-chdir($curdir);
-cleanall($temp_path);
-
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-array(2) {
- [0]=>
- string(4) "pkg1"
- [1]=>
- string(4) "pkg2"
-}
-pkg1 dir tree contains test/? yes
-pkg1 dir tree contains test/multiplepackages? yes
-pkg1 dir tree contains test/pkg1? yes
-pkg2 dir tree contains test/? yes
-pkg2 dir tree contains test/multiplepackages? yes
-pkg2 dir tree contains test/nestedroot? yes
-pkg2 dir tree contains test/nestedroot/emptydir? yes
-pkg2 dir tree contains test/nestedroot/emptydir/nesteddir? yes
-After uninstall of pkg1:
-test/ exists? yes
-test/multiplepackages exists? yes
-test/pkg1 exists? no
-test/nestedroot exists? yes
-test/nestedroot/emptydir exists? yes
-test/nestedroot/emptydir/nesteddir exists? yes
-array(1) {
- [0]=>
- string(4) "pkg2"
-}
-After uninstall of pkg2:
-test/ exists? no
-test/multiplepackages exists? no
-test/pkg1 exists? no
-test/nestedroot exists? no
-test/nestedroot/emptydir exists? no
-test/nestedroot/emptydir/nesteddir exists? no
-array(0) {
-} \ No newline at end of file
diff --git a/pear/tests/pear_packager.phpt b/pear/tests/pear_packager.phpt
deleted file mode 100644
index 9d584b2609..0000000000
--- a/pear/tests/pear_packager.phpt
+++ /dev/null
@@ -1,432 +0,0 @@
---TEST--
-PEAR_Packager test
---SKIPIF--
-<?php
-if (!getenv('PHP_PEAR_RUNTESTS')) {
- echo 'skip';
-}
-?>
---FILE--
-<?php
-$temp_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'testinstallertemp';
-if (!is_dir($temp_path)) {
- mkdir($temp_path);
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'php')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'php');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'doc');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'test')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'test');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'ext')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'ext');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
-}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
- mkdir($temp_path . DIRECTORY_SEPARATOR . 'bin');
-}
-// make the fake configuration - we'll use one of these and it should work
-$config = serialize(array('master_server' => 'pear.php.net',
- 'php_dir' => $temp_path . DIRECTORY_SEPARATOR . 'php',
- 'ext_dir' => $temp_path . DIRECTORY_SEPARATOR . 'ext',
- 'data_dir' => $temp_path . DIRECTORY_SEPARATOR . 'data',
- 'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
- 'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
- 'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
-fwrite($fp, $config);
-fclose($fp);
-touch($temp_path . DIRECTORY_SEPARATOR . 'pear.ini');
-$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.ini', 'w');
-fwrite($fp, $config);
-fclose($fp);
-
-putenv('PHP_PEAR_SYSCONF_DIR='.$temp_path);
-$home = getenv('HOME');
-if (!empty($home)) {
- // for PEAR_Config initialization
- putenv('HOME="'.$temp_path);
-}
-require_once "PEAR/Packager.php";
-
-$packager = new PEAR_Packager();
-$curdir = getcwd();
-chdir(dirname(__FILE__));
-
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
-
-$error_to_catch = false;
-function catchit($err)
-{
- global $error_to_catch;
- if ($error_to_catch) {
- if ($err->getMessage() == $error_to_catch) {
- $error_to_catch = false;
- echo "Caught expected error\n";
- return;
- }
- }
- echo "Caught error: " . $err->getMessage() . "\n";
-}
-ob_start();
-$packager->package(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' . DIRECTORY_SEPARATOR . 'package.xml');
-$packager->package(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' . DIRECTORY_SEPARATOR . 'package2.xml');
-$stuff = str_replace(array(dirname(__FILE__) . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), array('', '/'),
- ob_get_contents());
-ob_end_clean();
-echo $stuff;
-
-$archive1 = &new Archive_Tar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pkg1-1.0.tgz');
-$archive1c = &new Archive_Tar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' .
- DIRECTORY_SEPARATOR . 'pkg1-1.0.tgz');
-$x1 = $archive1->listContent();
-$x2 = $archive1c->listContent();
-for($i=0;$i<count($x1); $i++) {
- if ($x1[$i]['filename'] == 'package.xml') {
- unset($x1[$i]['mtime']);
- unset($x1[$i]['checksum']);
- }
-}
-for($i=0;$i<count($x2); $i++) {
- if ($x2[$i]['filename'] == 'package.xml') {
- unset($x2[$i]['mtime']);
- unset($x2[$i]['checksum']);
- }
-}
-var_dump($x1, $x2);
-$archive1 = &new Archive_Tar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pkg2-1.0.tgz');
-$archive1c = &new Archive_Tar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' .
- DIRECTORY_SEPARATOR . 'pkg2-1.0.tgz');
-$x1 = $archive1->listContent();
-$x2 = $archive1c->listContent();
-for($i=0;$i<count($x1); $i++) {
- if ($x1[$i]['filename'] == 'package.xml') {
- unset($x1[$i]['mtime']);
- unset($x1[$i]['checksum']);
- }
-}
-for($i=0;$i<count($x2); $i++) {
- if ($x2[$i]['filename'] == 'package.xml') {
- unset($x2[$i]['mtime']);
- unset($x2[$i]['checksum']);
- }
-}
-var_dump($x1, $x2);
-
-echo "test failure:\n";
-$packager->package(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dirtree' . DIRECTORY_SEPARATOR . 'package-fail.xml');
-
-unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pkg1-1.0.tgz');
-unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pkg2-1.0.tgz');
-chdir($curdir);
-cleanall($temp_path);
-
-// ------------------------------------------------------------------------- //
-
-function cleanall($dir)
-{
- $dp = opendir($dir);
- while ($ent = readdir($dp)) {
- if ($ent == '.' || $ent == '..') {
- continue;
- }
- if (is_dir($dir . DIRECTORY_SEPARATOR . $ent)) {
- cleanall($dir . DIRECTORY_SEPARATOR . $ent);
- } else {
- unlink($dir . DIRECTORY_SEPARATOR . $ent);
- }
- }
- closedir($dp);
- rmdir($dir);
-}
-?>
---GET--
---POST--
---EXPECT--
-Analyzing multiplepackages/pkg1file.php
-Analyzing pkg1/randomfile.php
-Package pkg1-1.0.tgz done
-Tag the released code with `pear cvstag package.xml'
-(or set the CVS tag RELEASE_1_0 by hand)
-Analyzing multiplepackages/pkg2file.php
-Analyzing nestedroot/rootfile.php
-Analyzing nestedroot/emptydir/nesteddir/nestedfile.php
-Package pkg2-1.0.tgz done
-Tag the released code with `pear cvstag package2.xml'
-(or set the CVS tag RELEASE_1_0 by hand)
-array(3) {
- [0]=>
- array(6) {
- ["filename"]=>
- string(11) "package.xml"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(817)
- ["typeflag"]=>
- string(0) ""
- }
- [1]=>
- array(8) {
- ["checksum"]=>
- int(5592)
- ["filename"]=>
- string(38) "pkg1-1.0/multiplepackages/pkg1file.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119017)
- ["typeflag"]=>
- string(0) ""
- }
- [2]=>
- array(8) {
- ["checksum"]=>
- int(4534)
- ["filename"]=>
- string(28) "pkg1-1.0/pkg1/randomfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071120110)
- ["typeflag"]=>
- string(0) ""
- }
-}
-array(3) {
- [0]=>
- array(6) {
- ["filename"]=>
- string(11) "package.xml"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(817)
- ["typeflag"]=>
- string(0) ""
- }
- [1]=>
- array(8) {
- ["checksum"]=>
- int(5592)
- ["filename"]=>
- string(38) "pkg1-1.0/multiplepackages/pkg1file.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119017)
- ["typeflag"]=>
- string(0) ""
- }
- [2]=>
- array(8) {
- ["checksum"]=>
- int(4534)
- ["filename"]=>
- string(28) "pkg1-1.0/pkg1/randomfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071120110)
- ["typeflag"]=>
- string(0) ""
- }
-}
-array(4) {
- [0]=>
- array(6) {
- ["filename"]=>
- string(11) "package.xml"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(921)
- ["typeflag"]=>
- string(0) ""
- }
- [1]=>
- array(8) {
- ["checksum"]=>
- int(5600)
- ["filename"]=>
- string(38) "pkg2-1.0/multiplepackages/pkg2file.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119030)
- ["typeflag"]=>
- string(0) ""
- }
- [2]=>
- array(8) {
- ["checksum"]=>
- int(5066)
- ["filename"]=>
- string(32) "pkg2-1.0/nestedroot/rootfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119266)
- ["typeflag"]=>
- string(0) ""
- }
- [3]=>
- array(8) {
- ["checksum"]=>
- int(7193)
- ["filename"]=>
- string(53) "pkg2-1.0/nestedroot/emptydir/nesteddir/nestedfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119310)
- ["typeflag"]=>
- string(0) ""
- }
-}
-array(4) {
- [0]=>
- array(6) {
- ["filename"]=>
- string(11) "package.xml"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(921)
- ["typeflag"]=>
- string(0) ""
- }
- [1]=>
- array(8) {
- ["checksum"]=>
- int(5600)
- ["filename"]=>
- string(38) "pkg2-1.0/multiplepackages/pkg2file.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119030)
- ["typeflag"]=>
- string(0) ""
- }
- [2]=>
- array(8) {
- ["checksum"]=>
- int(5066)
- ["filename"]=>
- string(32) "pkg2-1.0/nestedroot/rootfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119266)
- ["typeflag"]=>
- string(0) ""
- }
- [3]=>
- array(8) {
- ["checksum"]=>
- int(7193)
- ["filename"]=>
- string(53) "pkg2-1.0/nestedroot/emptydir/nesteddir/nestedfile.php"
- ["mode"]=>
- int(33206)
- ["uid"]=>
- int(0)
- ["gid"]=>
- int(0)
- ["size"]=>
- int(0)
- ["mtime"]=>
- int(1071119310)
- ["typeflag"]=>
- string(0) ""
- }
-}
-test failure:
-Analyzing multiplepackages\pkg2file.php
-Analyzing nestedroot\rootfile.php
-Analyzing nestedroot\emptydir\nesteddir\nestedfile.php
-Analyzing nestedroot\emptydir\nesteddir\doesntexist.php
-Caught error: File does not exist: nestedroot\emptydir\nesteddir\doesntexist.php \ No newline at end of file
diff --git a/pear/tests/test-pkg6/goompness/Mopreeb.php b/pear/tests/test-pkg6/goompness/Mopreeb.php
deleted file mode 100644
index 5422435ff8..0000000000
--- a/pear/tests/test-pkg6/goompness/Mopreeb.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-/**
- *
- *
- * @version $Id$
- * @copyright 2003
- **/
-class test1{}
-
-?> \ No newline at end of file
diff --git a/pear/tests/test-pkg6/goompness/oggbrzitzkee.php b/pear/tests/test-pkg6/goompness/oggbrzitzkee.php
deleted file mode 100644
index 5422435ff8..0000000000
--- a/pear/tests/test-pkg6/goompness/oggbrzitzkee.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-/**
- *
- *
- * @version $Id$
- * @copyright 2003
- **/
-class test1{}
-
-?> \ No newline at end of file
diff --git a/pear/tests/test-pkg6/invalidtgz.tgz b/pear/tests/test-pkg6/invalidtgz.tgz
deleted file mode 100644
index 909d507ca6..0000000000
--- a/pear/tests/test-pkg6/invalidtgz.tgz
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg6</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="groob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/test-pkg6/nopackagexml.tgz b/pear/tests/test-pkg6/nopackagexml.tgz
deleted file mode 100644
index 8b9d9aad02..0000000000
--- a/pear/tests/test-pkg6/nopackagexml.tgz
+++ /dev/null
Binary files differ
diff --git a/pear/tests/test-pkg6/package.xml b/pear/tests/test-pkg6/package.xml
deleted file mode 100644
index 102f972766..0000000000
--- a/pear/tests/test-pkg6/package.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
- <package version="1.0">
- <name>pkg6</name>
- <summary>required test for PEAR_Installer</summary>
- <description>
- fake package
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>fakeuser</user>
- <name>Joe Shmoe</name>
- <email>nobody@example.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <release>
- <version>1.1</version>
- <date>2003-09-09</date>
- <state>stable</state>
- <notes>
- required dependency test
- </notes>
- <filelist>
- <dir name="/" baseinstalldir="groob" role="php">
- <file>zoorb.php</file>
- <dir name="goompness" role="php">
- <file>oggbrzitzkee.php</file>
- <file>Mopreeb.php</file>
- </dir>
- </dir>
- </filelist>
- </release>
- </package>
diff --git a/pear/tests/test-pkg6/pkg6-1.1.tgz b/pear/tests/test-pkg6/pkg6-1.1.tgz
deleted file mode 100644
index 09868cab44..0000000000
--- a/pear/tests/test-pkg6/pkg6-1.1.tgz
+++ /dev/null
Binary files differ
diff --git a/pear/tests/test-pkg6/pkg6-2.0b1.tgz b/pear/tests/test-pkg6/pkg6-2.0b1.tgz
deleted file mode 100644
index 45e8877d61..0000000000
--- a/pear/tests/test-pkg6/pkg6-2.0b1.tgz
+++ /dev/null
Binary files differ
diff --git a/pear/tests/test-pkg6/zoorb.php b/pear/tests/test-pkg6/zoorb.php
deleted file mode 100644
index 5422435ff8..0000000000
--- a/pear/tests/test-pkg6/zoorb.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-/**
- *
- *
- * @version $Id$
- * @copyright 2003
- **/
-class test1{}
-
-?> \ No newline at end of file
diff --git a/pear/tests/testdownload.tgz b/pear/tests/testdownload.tgz
deleted file mode 100644
index 0ddc3df361..0000000000
--- a/pear/tests/testdownload.tgz
+++ /dev/null
Binary files differ