From 6f68407894ac41f17e99cc1baf12d794c9d03d4a Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 1 Mar 2004 20:40:51 +0000 Subject: [PATCH] - initial release, reflection tests suite --- ext/reflection/tests/exception.php | 16 +++++++++++ ext/reflection/tests/invoke.phpt | 44 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 ext/reflection/tests/exception.php create mode 100755 ext/reflection/tests/invoke.phpt diff --git a/ext/reflection/tests/exception.php b/ext/reflection/tests/exception.php new file mode 100644 index 0000000000..8570b6b360 --- /dev/null +++ b/ext/reflection/tests/exception.php @@ -0,0 +1,16 @@ +errno = $_errno; + $this->errmsg = $_errmsg; + } + + function getErrno() { + return $this->errno; + } + + function getErrmsg() { + return $this->errmsg; + } +} +?> diff --git a/ext/reflection/tests/invoke.phpt b/ext/reflection/tests/invoke.phpt new file mode 100755 index 0000000000..079ab43c2e --- /dev/null +++ b/ext/reflection/tests/invoke.phpt @@ -0,0 +1,44 @@ +--TEST-- +invoke with non object or null value +--FILE-- +getMethod("a"); + +try { + $m->invoke(null); +} catch (reflection_exception $E) { + echo $E->getMessage()."\n"; +} + + +try { + $m->invoke($b); +} catch (reflection_exception $E) { + echo $E->getMessage()."\n"; +} + +$b = new a(); +try { + $m->invoke($b); +} catch (reflection_exception $E) { + echo $E->getMessage()."\n"; +} + +echo "===DONE===\n";?> +--EXPECT-- +Non-object passed to Invoke() +Given object is not an instance of the class this method was declared in +===DONE=== -- 2.50.1