summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:28 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:28 -0400
commitba50031707469046407a35b77a3cd81351e951b3 (patch)
tree5c03e723bdbfabae09d41a3ab1253dff41eeed4a /ext/reflection/tests
parent0a36161e13484a99ccf69bb38f206462d27cc6d6 (diff)
downloadphp-upstream/5.1.5.tar.gz
Imported Upstream version 5.1.5upstream/5.1.5
Diffstat (limited to 'ext/reflection/tests')
-rwxr-xr-xext/reflection/tests/001.phpt2
-rwxr-xr-xext/reflection/tests/002.phpt2
-rwxr-xr-xext/reflection/tests/003.phpt4
-rwxr-xr-xext/reflection/tests/004.phpt4
-rwxr-xr-xext/reflection/tests/005.phpt2
-rwxr-xr-xext/reflection/tests/006.phpt2
-rwxr-xr-xext/reflection/tests/007.phpt162
-rwxr-xr-xext/reflection/tests/bug26640.phpt4
-rwxr-xr-xext/reflection/tests/bug26695.phpt4
-rwxr-xr-xext/reflection/tests/bug29268.phpt9
-rwxr-xr-xext/reflection/tests/bug29523.phpt4
-rwxr-xr-xext/reflection/tests/bug29828.phpt4
-rw-r--r--ext/reflection/tests/bug29986.phpt41
-rwxr-xr-xext/reflection/tests/bug30146.phpt4
-rwxr-xr-xext/reflection/tests/bug30148.phpt4
-rwxr-xr-xext/reflection/tests/bug30209.phpt4
-rwxr-xr-xext/reflection/tests/bug30856.phpt4
-rwxr-xr-xext/reflection/tests/bug30961.phpt4
-rwxr-xr-xext/reflection/tests/bug31651.phpt4
-rwxr-xr-xext/reflection/tests/bug32981.phpt4
-rwxr-xr-xext/reflection/tests/bug33312.phpt4
-rwxr-xr-xext/reflection/tests/bug33389.phpt4
-rwxr-xr-xext/reflection/tests/bug36308.phpt22
-rw-r--r--ext/reflection/tests/bug36337.phpt30
-rw-r--r--ext/reflection/tests/bug36434.phpt33
-rwxr-xr-xext/reflection/tests/parameters_001.phpt4
-rwxr-xr-xext/reflection/tests/parameters_002.phpt209
-rwxr-xr-xext/reflection/tests/property_exists.phpt4
-rwxr-xr-xext/reflection/tests/static_properties_002.phpt4
29 files changed, 564 insertions, 22 deletions
diff --git a/ext/reflection/tests/001.phpt b/ext/reflection/tests/001.phpt
index 6a9d31a30..55458885c 100755
--- a/ext/reflection/tests/001.phpt
+++ b/ext/reflection/tests/001.phpt
@@ -1,5 +1,7 @@
--TEST--
Reflection inheritance
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/002.phpt b/ext/reflection/tests/002.phpt
index bef4c8166..9b233d372 100755
--- a/ext/reflection/tests/002.phpt
+++ b/ext/reflection/tests/002.phpt
@@ -1,5 +1,7 @@
--TEST--
Reflection properties are read only
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/003.phpt b/ext/reflection/tests/003.phpt
index 660389255..af8d82d57 100755
--- a/ext/reflection/tests/003.phpt
+++ b/ext/reflection/tests/003.phpt
@@ -1,5 +1,7 @@
--TEST--
-invoke() with base class method
+ReflectionMethod::invoke() with base class method
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/004.phpt b/ext/reflection/tests/004.phpt
index f8a448e6c..912d52654 100755
--- a/ext/reflection/tests/004.phpt
+++ b/ext/reflection/tests/004.phpt
@@ -1,5 +1,7 @@
--TEST--
-invoke() with non object or null value
+ReflectionMethod::invoke() with non object or null value
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/005.phpt b/ext/reflection/tests/005.phpt
index f337e44ae..bedc7d032 100755
--- a/ext/reflection/tests/005.phpt
+++ b/ext/reflection/tests/005.phpt
@@ -1,5 +1,7 @@
--TEST--
ReflectionMethod::getDocComment() uses wrong comment block
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/006.phpt b/ext/reflection/tests/006.phpt
index 89c438765..9e97ae465 100755
--- a/ext/reflection/tests/006.phpt
+++ b/ext/reflection/tests/006.phpt
@@ -1,5 +1,7 @@
--TEST--
ReflectionClass::[gs]etStaticPropertyValue
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/007.phpt b/ext/reflection/tests/007.phpt
new file mode 100755
index 000000000..83764e551
--- /dev/null
+++ b/ext/reflection/tests/007.phpt
@@ -0,0 +1,162 @@
+--TEST--
+ReflectionClass::newInstance[Args]
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+
+function test($class)
+{
+ echo "====>$class\n";
+ try
+ {
+ $ref = new ReflectionClass($class);
+ }
+ catch (ReflectionException $e)
+ {
+ var_dump($e->getMessage());
+ return; // only here
+ }
+
+ echo "====>newInstance()\n";
+ try
+ {
+ var_dump($ref->newInstance());
+ }
+ catch (ReflectionException $e)
+ {
+ var_dump($e->getMessage());
+ }
+
+ echo "====>newInstance(25)\n";
+ try
+ {
+ var_dump($ref->newInstance(25));
+ }
+ catch (ReflectionException $e)
+ {
+ var_dump($e->getMessage());
+ }
+
+ echo "====>newInstance(25, 42)\n";
+ try
+ {
+ var_dump($ref->newInstance(25, 42));
+ }
+ catch (ReflectionException $e)
+ {
+ var_dump($e->getMessage());
+ }
+
+ echo "\n";
+}
+
+function __autoload($class)
+{
+ echo __FUNCTION__ . "($class)\n";
+}
+
+test('Class_does_not_exist');
+
+Class NoCtor
+{
+}
+
+test('NoCtor');
+
+Class WithCtor
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ var_dump(func_get_args());
+ }
+}
+
+test('WithCtor');
+
+Class WithCtorWithArgs
+{
+ function __construct($arg)
+ {
+ echo __METHOD__ . "($arg)\n";
+ var_dump(func_get_args());
+ }
+}
+
+test('WithCtorWithArgs');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+
+====>Class_does_not_exist
+__autoload(Class_does_not_exist)
+string(41) "Class Class_does_not_exist does not exist"
+====>NoCtor
+====>newInstance()
+object(NoCtor)#%d (0) {
+}
+====>newInstance(25)
+string(86) "Class NoCtor does not have a constructor, so you cannot pass any constructor arguments"
+====>newInstance(25, 42)
+string(86) "Class NoCtor does not have a constructor, so you cannot pass any constructor arguments"
+
+====>WithCtor
+====>newInstance()
+WithCtor::__construct()
+array(0) {
+}
+object(WithCtor)#%d (0) {
+}
+====>newInstance(25)
+WithCtor::__construct()
+array(1) {
+ [0]=>
+ int(25)
+}
+object(WithCtor)#%d (0) {
+}
+====>newInstance(25, 42)
+WithCtor::__construct()
+array(2) {
+ [0]=>
+ int(25)
+ [1]=>
+ int(42)
+}
+object(WithCtor)#%d (0) {
+}
+
+====>WithCtorWithArgs
+====>newInstance()
+
+Warning: Missing argument 1 for WithCtorWithArgs::__construct() in %s007.php on line %d
+
+Notice: Undefined variable: arg in %s007.php on line %d
+WithCtorWithArgs::__construct()
+array(0) {
+}
+object(WithCtorWithArgs)#%d (0) {
+}
+====>newInstance(25)
+WithCtorWithArgs::__construct(25)
+array(1) {
+ [0]=>
+ int(25)
+}
+object(WithCtorWithArgs)#%d (0) {
+}
+====>newInstance(25, 42)
+WithCtorWithArgs::__construct(25)
+array(2) {
+ [0]=>
+ int(25)
+ [1]=>
+ int(42)
+}
+object(WithCtorWithArgs)#%d (0) {
+}
+
+===DONE===
diff --git a/ext/reflection/tests/bug26640.phpt b/ext/reflection/tests/bug26640.phpt
index 2cbd0d23d..026e67561 100755
--- a/ext/reflection/tests/bug26640.phpt
+++ b/ext/reflection/tests/bug26640.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #26640 (__autoload() not invoked by Reflection classes)
+Reflection Bug #26640 (__autoload() not invoked by Reflection classes)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug26695.phpt b/ext/reflection/tests/bug26695.phpt
index 38e6607c3..c62395325 100755
--- a/ext/reflection/tests/bug26695.phpt
+++ b/ext/reflection/tests/bug26695.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #26695 (Reflection API does not recognize mixed-case class hints)
+Reflection Bug #26695 (Reflection API does not recognize mixed-case class hints)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug29268.phpt b/ext/reflection/tests/bug29268.phpt
index 335ee7337..9f17a5e11 100755
--- a/ext/reflection/tests/bug29268.phpt
+++ b/ext/reflection/tests/bug29268.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #29268 (__autoload() not called with reflectionProperty->getClass())
+Reflection Bug #29268 (__autoload() not called with reflectionProperty->getClass())
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
function __autoload($classname) {
@@ -14,8 +16,9 @@ class B{
$ref = new reflectionMethod('B','doit');
$parameters = $ref->getParameters();
-foreach($parameters as $parameter){
- $class = $parameter->getClass();
+foreach($parameters as $parameter)
+{
+ $class = $parameter->getClass();
echo $class->name."\n";
}
echo "ok\n";
diff --git a/ext/reflection/tests/bug29523.phpt b/ext/reflection/tests/bug29523.phpt
index 4eb357cc2..e952d0ffe 100755
--- a/ext/reflection/tests/bug29523.phpt
+++ b/ext/reflection/tests/bug29523.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #29523 (ReflectionParameter::isOptional() is incorrect)
+Reflection Bug #29523 (ReflectionParameter::isOptional() is incorrect)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug29828.phpt b/ext/reflection/tests/bug29828.phpt
index e1c9bbd36..f9052ac6b 100755
--- a/ext/reflection/tests/bug29828.phpt
+++ b/ext/reflection/tests/bug29828.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #29828 (Interfaces no longer work)
+Reflection Bug #29828 (Interfaces no longer work)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug29986.phpt b/ext/reflection/tests/bug29986.phpt
new file mode 100644
index 000000000..85bad6d6e
--- /dev/null
+++ b/ext/reflection/tests/bug29986.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Reflection Bug #29986 (Class constants won't work with predefined constants when using ReflectionClass)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class just_constants
+{
+ const BOOLEAN_CONSTANT = true;
+ const NULL_CONSTANT = null;
+ const STRING_CONSTANT = 'This is a string';
+ const INTEGER_CONSTANT = 1000;
+ const FLOAT_CONSTANT = 3.14159265;
+}
+
+Reflection::export(new ReflectionClass('just_constants'));
+?>
+--EXPECTF--
+Class [ <user> class just_constants ] {
+ @@ %s
+
+ - Constants [5] {
+ Constant [ boolean BOOLEAN_CONSTANT ] { }
+ Constant [ null NULL_CONSTANT ] { }
+ Constant [ string STRING_CONSTANT ] { }
+ Constant [ integer INTEGER_CONSTANT ] { }
+ Constant [ double FLOAT_CONSTANT ] { }
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [0] {
+ }
+}
diff --git a/ext/reflection/tests/bug30146.phpt b/ext/reflection/tests/bug30146.phpt
index 72c6d2e5f..d7dd2fc21 100755
--- a/ext/reflection/tests/bug30146.phpt
+++ b/ext/reflection/tests/bug30146.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #30146 (ReflectionProperty->getValue() requires instance for static property)
+Reflection Bug #30146 (ReflectionProperty->getValue() requires instance for static property)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
class test {
diff --git a/ext/reflection/tests/bug30148.phpt b/ext/reflection/tests/bug30148.phpt
index bc4415bfd..91bc31b65 100755
--- a/ext/reflection/tests/bug30148.phpt
+++ b/ext/reflection/tests/bug30148.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #30148 (ReflectionMethod->isConstructor() fails for inherited classes)
+Reflection Bug #30148 (ReflectionMethod->isConstructor() fails for inherited classes)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug30209.phpt b/ext/reflection/tests/bug30209.phpt
index 6705c6704..bab16ee35 100755
--- a/ext/reflection/tests/bug30209.phpt
+++ b/ext/reflection/tests/bug30209.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #30209 (ReflectionClass::getMethod() lowercases attribute)
+Reflection Bug #30209 (ReflectionClass::getMethod() lowercases attribute)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug30856.phpt b/ext/reflection/tests/bug30856.phpt
index 6c6d3171a..eaa6cf289 100755
--- a/ext/reflection/tests/bug30856.phpt
+++ b/ext/reflection/tests/bug30856.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #30856 (ReflectionClass::getStaticProperties segfaults)
+Reflection Bug #30856 (ReflectionClass::getStaticProperties segfaults)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
class bogus {
diff --git a/ext/reflection/tests/bug30961.phpt b/ext/reflection/tests/bug30961.phpt
index 67964343e..c765e7cc8 100755
--- a/ext/reflection/tests/bug30961.phpt
+++ b/ext/reflection/tests/bug30961.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #30961 (Wrong linenumber in ReflectionClass getStartLine())
+Reflection Bug #30961 (Wrong linenumber in ReflectionClass getStartLine())
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
class a
diff --git a/ext/reflection/tests/bug31651.phpt b/ext/reflection/tests/bug31651.phpt
index 60bee14e9..66a56c0f4 100755
--- a/ext/reflection/tests/bug31651.phpt
+++ b/ext/reflection/tests/bug31651.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.)
+Reflection Bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug32981.phpt b/ext/reflection/tests/bug32981.phpt
index 1f89ca682..53214d7aa 100755
--- a/ext/reflection/tests/bug32981.phpt
+++ b/ext/reflection/tests/bug32981.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault)
+Reflection Bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/bug33312.phpt b/ext/reflection/tests/bug33312.phpt
index 3784b56a6..2413a3dc3 100755
--- a/ext/reflection/tests/bug33312.phpt
+++ b/ext/reflection/tests/bug33312.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #33312 (ReflectionParameter methods do not work correctly)
+Reflection Bug #33312 (ReflectionParameter methods do not work correctly)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
class Foo {
diff --git a/ext/reflection/tests/bug33389.phpt b/ext/reflection/tests/bug33389.phpt
index 36f7079e2..d2a84e212 100755
--- a/ext/reflection/tests/bug33389.phpt
+++ b/ext/reflection/tests/bug33389.phpt
@@ -1,5 +1,7 @@
--TEST--
-Bug #33389 (double free() when exporting a ReflectionClass)
+Reflection Bug #33389 (double free() when exporting a ReflectionClass)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
define ('foobar', 1);
diff --git a/ext/reflection/tests/bug36308.phpt b/ext/reflection/tests/bug36308.phpt
new file mode 100755
index 000000000..52717b474
--- /dev/null
+++ b/ext/reflection/tests/bug36308.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Reflection Bug #36308 (ReflectionProperty::getDocComment() does not reflect extended class commentary)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class Base {
+ /** Base comment block */
+ public $foo = 'bar';
+}
+
+class Extended extends Base {
+ /** Extended commentary */
+ public $foo = 'zim';
+}
+
+$reflect = new ReflectionClass('Extended');
+$props = $reflect->getProperties();
+echo $props[0]->getDocComment();
+?>
+--EXPECT--
+/** Extended commentary */ \ No newline at end of file
diff --git a/ext/reflection/tests/bug36337.phpt b/ext/reflection/tests/bug36337.phpt
new file mode 100644
index 000000000..8ec928fc8
--- /dev/null
+++ b/ext/reflection/tests/bug36337.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Reflection Bug #36337 (ReflectionProperty fails to return correct visibility)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+
+abstract class enum {
+ protected $_values;
+
+ public function __construct() {
+ $property = new ReflectionProperty(get_class($this),'_values');
+ var_dump($property->isProtected());
+ }
+
+}
+
+final class myEnum extends enum {
+ public $_values = array(
+ 0 => 'No value',
+ );
+}
+
+$x = new myEnum();
+
+echo "Done\n";
+?>
+--EXPECT--
+bool(false)
+Done
diff --git a/ext/reflection/tests/bug36434.phpt b/ext/reflection/tests/bug36434.phpt
new file mode 100644
index 000000000..e305c657a
--- /dev/null
+++ b/ext/reflection/tests/bug36434.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Reflection Bug #36434 (Properties from parent class fail to indetify their true origin)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class ancester
+{
+public $ancester = 0;
+ function ancester()
+ {
+ return $this->ancester;
+ }
+}
+class foo extends ancester
+{
+public $bar = "1";
+ function foo()
+ {
+ return $this->bar;
+ }
+}
+
+$r = new ReflectionClass('foo');
+foreach ($r->GetProperties() as $p)
+{
+ echo $p->getName(). " ". $p->getDeclaringClass()->getName()."\n";
+}
+
+?>
+--EXPECT--
+bar foo
+ancester ancester
diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt
index 0879756ea..036f11973 100755
--- a/ext/reflection/tests/parameters_001.phpt
+++ b/ext/reflection/tests/parameters_001.phpt
@@ -1,5 +1,7 @@
--TEST--
-Check for parameter being optional
+ReflectionParameter Check for parameter being optional
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/parameters_002.phpt b/ext/reflection/tests/parameters_002.phpt
new file mode 100755
index 000000000..6f911448c
--- /dev/null
+++ b/ext/reflection/tests/parameters_002.phpt
@@ -0,0 +1,209 @@
+--TEST--
+ReflectionParameter::getClass(), getDeclaringClass(), getDeclaringFunction()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+
+function test($nix, Array $ar, &$ref, stdClass $std, NonExistingClass $na, stdClass &$opt = NULL, $def = "FooBar")
+{
+}
+
+class test
+{
+ function test($nix, Array $ar, &$ref, stdClass $std, NonExistingClass $na, stdClass $opt = NULL, $def = "FooBar")
+ {
+ }
+}
+
+function check_params_decl_func($r, $f)
+{
+ $c = $r->$f();
+ echo $f . ': ' . ($c ? ($c instanceof ReflectionMethod ? $c->class . '::' : '') . $c->name : 'NULL') . "()\n";
+}
+
+function check_params_decl_class($r, $f)
+{
+ $c = $r->$f();
+ echo $f . ': ' . ($c ? $c->name : 'NULL') . "\n";
+}
+
+function check_params_func($r, $f)
+{
+ echo $f . ': ';
+ $v = $r->$f();
+ var_dump($v);
+}
+
+function check_params($r)
+{
+ echo "#####" . ($r instanceof ReflectionMethod ? $r->class . '::' : '') . $r->name . "()#####\n";
+ $i = 0;
+ foreach($r->getParameters() as $p)
+ {
+ echo "===" . $i . "===\n";
+ $i++;
+ check_params_func($p, 'getName');
+ check_params_func($p, 'isPassedByReference');
+ try
+ {
+ check_params_decl_class($p, 'getClass');
+ }
+ catch(ReflectionException $e)
+ {
+ echo $e->getMessage() . "\n";
+ }
+ check_params_decl_class($p, 'getDeclaringClass');
+// check_params_decl_func($p, 'getDeclaringFunction');
+ check_params_func($p, 'isArray');
+ check_params_func($p, 'allowsNull');
+ check_params_func($p, 'isOptional');
+ check_params_func($p, 'isDefaultValueAvailable');
+ if ($p->isOptional())
+ {
+ check_params_func($p, 'getDefaultValue');
+ }
+ }
+}
+
+check_params(new ReflectionFunction('test'));
+
+check_params(new ReflectionMethod('test::test'));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+#####test()#####
+===0===
+getName: string(3) "nix"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===1===
+getName: string(2) "ar"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: NULL
+isArray: bool(true)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===2===
+getName: string(3) "ref"
+isPassedByReference: bool(true)
+getClass: NULL
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===3===
+getName: string(3) "std"
+isPassedByReference: bool(false)
+getClass: stdClass
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===4===
+getName: string(2) "na"
+isPassedByReference: bool(false)
+Class NonExistingClass does not exist
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===5===
+getName: string(3) "opt"
+isPassedByReference: bool(true)
+getClass: stdClass
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(true)
+isDefaultValueAvailable: bool(true)
+getDefaultValue: NULL
+===6===
+getName: string(3) "def"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: NULL
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(true)
+isDefaultValueAvailable: bool(true)
+getDefaultValue: string(6) "FooBar"
+#####test::test()#####
+===0===
+getName: string(3) "nix"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===1===
+getName: string(2) "ar"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: test
+isArray: bool(true)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===2===
+getName: string(3) "ref"
+isPassedByReference: bool(true)
+getClass: NULL
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===3===
+getName: string(3) "std"
+isPassedByReference: bool(false)
+getClass: stdClass
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===4===
+getName: string(2) "na"
+isPassedByReference: bool(false)
+Class NonExistingClass does not exist
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(false)
+isOptional: bool(false)
+isDefaultValueAvailable: bool(false)
+===5===
+getName: string(3) "opt"
+isPassedByReference: bool(false)
+getClass: stdClass
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(true)
+isDefaultValueAvailable: bool(true)
+getDefaultValue: NULL
+===6===
+getName: string(3) "def"
+isPassedByReference: bool(false)
+getClass: NULL
+getDeclaringClass: test
+isArray: bool(false)
+allowsNull: bool(true)
+isOptional: bool(true)
+isDefaultValueAvailable: bool(true)
+getDefaultValue: string(6) "FooBar"
+===DONE===
diff --git a/ext/reflection/tests/property_exists.phpt b/ext/reflection/tests/property_exists.phpt
index fa712dfdb..8fd45f2b8 100755
--- a/ext/reflection/tests/property_exists.phpt
+++ b/ext/reflection/tests/property_exists.phpt
@@ -1,5 +1,7 @@
--TEST--
-ZE2 property_exists()
+Reflection and property_exists()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php
diff --git a/ext/reflection/tests/static_properties_002.phpt b/ext/reflection/tests/static_properties_002.phpt
index 29b84a8e6..051b9fb10 100755
--- a/ext/reflection/tests/static_properties_002.phpt
+++ b/ext/reflection/tests/static_properties_002.phpt
@@ -1,7 +1,7 @@
--TEST--
-ZE2 Inheriting static properties
+Reflection and inheriting static properties
--SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+<?php extension_loaded('reflection') or die('skip'); ?>
--FILE--
<?php