summaryrefslogtreecommitdiff
path: root/pear/tests
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2001-08-08 15:06:09 +0000
committerSVN Migration <svn@php.net>2001-08-08 15:06:09 +0000
commit22909a77ef3489ef6be3c860d0002ea66c4436f0 (patch)
tree480ca7c565161cc36eddc9f8eee073ef10be3019 /pear/tests
parent2f6cd308f9a8c53e0ce359603f4746b27bc32356 (diff)
downloadphp-git-PRE_METHOD_DEREFERENCE_PATCH.tar.gz
This commit was manufactured by cvs2svn to create tagPRE_METHOD_DEREFERENCE_PATCH
'PRE_METHOD_DEREFERENCE_PATCH'.
Diffstat (limited to 'pear/tests')
-rw-r--r--pear/tests/PEAR.r3
-rw-r--r--pear/tests/PEAR.t16
-rw-r--r--pear/tests/PEAR_Error.r20
-rw-r--r--pear/tests/PEAR_Error.t18
-rw-r--r--pear/tests/pear1.phpt58
-rw-r--r--pear/tests/pear_error.phpt128
-rw-r--r--pear/tests/pear_error2.phpt24
-rw-r--r--pear/tests/pear_error3.phpt40
-rw-r--r--pear/tests/php.ini2
9 files changed, 0 insertions, 309 deletions
diff --git a/pear/tests/PEAR.r b/pear/tests/PEAR.r
deleted file mode 100644
index e8210eee35..0000000000
--- a/pear/tests/PEAR.r
+++ /dev/null
@@ -1,3 +0,0 @@
-test class __TestPEAR1
-PEAR constructor called, class=__testpear1
-string(11) "__testpear1"
diff --git a/pear/tests/PEAR.t b/pear/tests/PEAR.t
deleted file mode 100644
index 6c8346adc7..0000000000
--- a/pear/tests/PEAR.t
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php // -*- C++ -*-
-
-require_once "PEAR.php";
-
-class __TestPEAR1 extends PEAR {
- function __TestPEAR1() {
- $this->_debug = true;
- $this->PEAR();
- }
-}
-
-print "test class __TestPEAR1\n";
-$o = new __TestPEAR1;
-var_dump(get_class($o));
-
-?>
diff --git a/pear/tests/PEAR_Error.r b/pear/tests/PEAR_Error.r
deleted file mode 100644
index fce8a664a7..0000000000
--- a/pear/tests/PEAR_Error.r
+++ /dev/null
@@ -1,20 +0,0 @@
-new PEAR_Error object(pear_error)(8) {
- ["classname"]=>
- string(10) "pear_error"
- ["error_message_prefix"]=>
- string(0) ""
- ["error_prepend"]=>
- string(0) ""
- ["error_append"]=>
- string(0) ""
- ["mode"]=>
- int(0)
- ["level"]=>
- int(1024)
- ["message"]=>
- string(13) "unknown error"
- ["code"]=>
- int(0)
-}
-isError 1 bool(true)
-isError 2 bool(false)
diff --git a/pear/tests/PEAR_Error.t b/pear/tests/PEAR_Error.t
deleted file mode 100644
index 4fae7b4cda..0000000000
--- a/pear/tests/PEAR_Error.t
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php // -*- C++ -*-
-
-// Test for: PEAR.php
-// Parts tested: - PEAR_Error class
-// - PEAR::isError static method
-// testing PEAR_Error
-
-require_once "PEAR.php";
-
-print "new PEAR_Error ";
-var_dump($err = new PEAR_Error);
-print "isError 1 ";
-var_dump(PEAR::isError($err));
-print "isError 2 ";
-$str = "not an error";
-var_dump(PEAR::isError($str));
-
-?>
diff --git a/pear/tests/pear1.phpt b/pear/tests/pear1.phpt
deleted file mode 100644
index 07b737f5bc..0000000000
--- a/pear/tests/pear1.phpt
+++ /dev/null
@@ -1,58 +0,0 @@
---TEST--
-PEAR constructor/destructor test
---SKIPIF--
---FILE--
-<?php
-
-require_once "PEAR.php";
-
-class TestPEAR extends PEAR {
- function TestPEAR($name) {
- $this->_debug = true;
- $this->name = $name;
- $this->PEAR();
- }
- function _TestPEAR() {
- print "This is the TestPEAR($this->name) destructor\n";
- $this->_PEAR();
- }
-}
-
-class Test2 extends PEAR {
- function _Test2() {
- print "This is the Test2 destructor\n";
- $this->_PEAR();
- }
-}
-
-class Test3 extends Test2 {
-}
-
-print "testing plain destructors\n";
-$o = new TestPEAR("test1");
-$p = new TestPEAR("test2");
-print "..\n";
-print "testing inherited destructors\n";
-$q = new Test3;
-
-print "..\n";
-print "script exiting...\n";
-print "..\n";
-
-?>
---GET--
---POST--
---EXPECT--
-testing plain destructors
-PEAR constructor called, class=testpear
-PEAR constructor called, class=testpear
-..
-testing inherited destructors
-..
-script exiting...
-..
-This is the TestPEAR(test1) destructor
-PEAR destructor called, class=testpear
-This is the TestPEAR(test2) destructor
-PEAR destructor called, class=testpear
-This is the Test2 destructor
diff --git a/pear/tests/pear_error.phpt b/pear/tests/pear_error.phpt
deleted file mode 100644
index e42085403b..0000000000
--- a/pear/tests/pear_error.phpt
+++ /dev/null
@@ -1,128 +0,0 @@
---TEST--
-PEAR_Error test
---SKIPIF--
---FILE--
-<?php // -*- C++ -*-
-
-// Test for: PEAR.php
-// Parts tested: - PEAR_Error class
-// - PEAR::isError static method
-// testing PEAR_Error
-
-require_once "PEAR.php";
-
-error_reporting(4095);
-
-class Foo_Error extends PEAR_Error {
- function Foo_Error($message = "unknown error", $code = null,
- $mode = null, $options = null, $userinfo = null)
- {
- $this->PEAR_Error($message, $code, $mode, $options, $userinfo);
- $this->error_message_prefix = 'Foo_Error prefix';
- }
-}
-
-class Test1 extends PEAR {
- function Test1() {
- $this->PEAR("Foo_Error");
- }
- function runtest() {
- return $this->raiseError("test error");
- }
-}
-
-function errorhandler(&$obj) {
- print "errorhandler function called, obj=".$obj->toString()."\n";
-}
-
-class errorclass {
- function errorhandler(&$obj) {
- print "errorhandler method called, obj=".$obj->toString()."\n";
- }
-}
-
-print "specify error class: ";
-$obj = new Test1;
-$err = $obj->runtest();
-print $err->toString() . "\n";
-
-$eo = new errorclass;
-
-print "default PEAR_Error: ";
-$err = new PEAR_Error;
-print $err->toString() . "\n";
-print "Testing it: ";
-var_dump(PEAR::isError($err));
-print "This is not an error: ";
-$str = "not an error";
-var_dump(PEAR::isError($str));
-
-print "Now trying a bunch of variations...\n";
-
-print "different message: ";
-$err = new PEAR_Error("test error");
-print $err->toString() . "\n";
-
-print "different message,code: ";
-$err = new PEAR_Error("test error", -42);
-print $err->toString() . "\n";
-
-print "mode=print: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_PRINT);
-print $err->toString() . "\n";
-
-print "mode=callback(function): ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_CALLBACK, "errorhandler");
-
-print "mode=callback(method): ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_CALLBACK,
- array(&$eo, "errorhandler"));
-
-print "mode=print&trigger: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_PRINT|PEAR_ERROR_TRIGGER);
-print $err->toString() . "\n";
-
-print "mode=trigger: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_TRIGGER);
-print $err->toString() . "\n";
-
-print "mode=trigger,level=notice: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_TRIGGER, E_USER_NOTICE);
-print $err->toString() . "\n";
-
-print "mode=trigger,level=warning: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_TRIGGER, E_USER_WARNING);
-print $err->toString() . "\n";
-
-print "mode=trigger,level=error: ";
-$err = new PEAR_Error("test error", -42, PEAR_ERROR_TRIGGER, E_USER_ERROR);
-print $err->toString() . "\n";
-
-?>
---GET--
---POST--
---EXPECT--
-specify error class: [foo_error: message="test error" code=0 mode=return level=notice prefix="Foo_Error prefix" prepend="" append="" info=""]
-default PEAR_Error: [pear_error: message="unknown error" code=0 mode=return level=notice prefix="" prepend="" append="" info=""]
-Testing it: bool(true)
-This is not an error: bool(false)
-Now trying a bunch of variations...
-different message: [pear_error: message="test error" code=0 mode=return level=notice prefix="" prepend="" append="" info=""]
-different message,code: [pear_error: message="test error" code=-42 mode=return level=notice prefix="" prepend="" append="" info=""]
-mode=print: test error[pear_error: message="test error" code=-42 mode=print level=notice prefix="" prepend="" append="" info=""]
-mode=callback(function): errorhandler function called, obj=[pear_error: message="test error" code=-42 mode=callback callback=errorhandler prefix="" prepend="" append="" info=""]
-mode=callback(method): errorhandler method called, obj=[pear_error: message="test error" code=-42 mode=callback callback=errorclass::errorhandler prefix="" prepend="" append="" info=""]
-mode=print&trigger: test error<br>
-<b>Notice</b>: test error in <b>/usr/local/share/php/pear/PEAR.php</b> on line <b>401</b><br>
-[pear_error: message="test error" code=-42 mode=print|trigger level=notice prefix="" prepend="" append="" info=""]
-mode=trigger: <br>
-<b>Notice</b>: test error in <b>/usr/local/share/php/pear/PEAR.php</b> on line <b>401</b><br>
-[pear_error: message="test error" code=-42 mode=trigger level=notice prefix="" prepend="" append="" info=""]
-mode=trigger,level=notice: <br>
-<b>Notice</b>: test error in <b>/usr/local/share/php/pear/PEAR.php</b> on line <b>401</b><br>
-[pear_error: message="test error" code=-42 mode=trigger level=notice prefix="" prepend="" append="" info=""]
-mode=trigger,level=warning: <br>
-<b>Warning</b>: test error in <b>/usr/local/share/php/pear/PEAR.php</b> on line <b>401</b><br>
-[pear_error: message="test error" code=-42 mode=trigger level=warning prefix="" prepend="" append="" info=""]
-mode=trigger,level=error: <br>
-<b>Fatal error</b>: test error in <b>/usr/local/share/php/pear/PEAR.php</b> on line <b>401</b><br>
diff --git a/pear/tests/pear_error2.phpt b/pear/tests/pear_error2.phpt
deleted file mode 100644
index 8d2531380e..0000000000
--- a/pear/tests/pear_error2.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-PEAR_Error in die mode
---SKIPIF--
---FILE--
-<?php // -*- C++ -*-
-
-// Test for: PEAR.php
-// Parts tested: - PEAR_Error class
-// - PEAR::isError static method
-// testing PEAR_Error
-
-require_once "PEAR.php";
-
-error_reporting(4095);
-
-print "mode=die: ";
-$err = new PEAR_Error("test error!!\n", -42, PEAR_ERROR_DIE);
-print $err->toString() . "\n";
-
-?>
---GET--
---POST--
---EXPECT--
-mode=die: test error!!
diff --git a/pear/tests/pear_error3.phpt b/pear/tests/pear_error3.phpt
deleted file mode 100644
index 4703a222b6..0000000000
--- a/pear/tests/pear_error3.phpt
+++ /dev/null
@@ -1,40 +0,0 @@
---TEST--
-PEAR default error handling
---FILE--
-<?php // -*- C++ -*-
-
-// Test for: PEAR.php
-// Parts tested: - PEAR_Error class
-// - PEAR::setErrorHandling
-// - PEAR::raiseError method
-
-require_once "PEAR.php";
-
-error_reporting(4095);
-
-function errorhandler($eobj)
-{
- if (PEAR::isError($eobj)) {
- print "errorhandler called with an error object.\n";
- print "error message: ".$eobj->getMessage()."\n";
- } else {
- print "errorhandler called, but without an error object.\n";
- }
-}
-
-$obj = new PEAR;
-$obj->setErrorHandling(PEAR_ERROR_PRINT);
-$obj->raiseError("error 1\n");
-$obj->setErrorHandling(null);
-$obj->raiseError("error 2\n");
-PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "errorhandler");
-$obj->raiseError("error 3\n");
-$obj->setErrorHandling(PEAR_ERROR_PRINT);
-$obj->raiseError("error 4\n");
-
-?>
---EXPECT--
-error 1
-errorhandler called with an error object.
-error message: error 3
-error 4
diff --git a/pear/tests/php.ini b/pear/tests/php.ini
deleted file mode 100644
index c75c9b4f11..0000000000
--- a/pear/tests/php.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-; php.ini for PEAR tests
-include_path=..