]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_5_0'.
authorSVN Migration <svn@php.net>
Thu, 23 Sep 2004 18:38:35 +0000 (18:38 +0000)
committerSVN Migration <svn@php.net>
Thu, 23 Sep 2004 18:38:35 +0000 (18:38 +0000)
ext/reflection/tests/bug30146.phpt [new file with mode: 0755]
ext/reflection/tests/bug30148.phpt [new file with mode: 0755]
ext/reflection/tests/bug30209.phpt [new file with mode: 0755]

diff --git a/ext/reflection/tests/bug30146.phpt b/ext/reflection/tests/bug30146.phpt
new file mode 100755 (executable)
index 0000000..4f48985
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Bug #30146 (ReflectionProperty->getValue() requires instance for static property)
+--FILE--
+<?php
+class test {
+  static public $a = 1;
+}
+
+$r = new ReflectionProperty('test', 'a');
+var_dump($r->getValue(null));
+
+$r->setValue(NULL, 2);
+var_dump($r->getValue());
+
+$r->setValue(3);
+var_dump($r->getValue());
+?>
+===DONE===
+--EXPECT--
+int(1)
+int(2)
+int(3)
+===DONE===
\ No newline at end of file
diff --git a/ext/reflection/tests/bug30148.phpt b/ext/reflection/tests/bug30148.phpt
new file mode 100755 (executable)
index 0000000..c3bfd06
--- /dev/null
@@ -0,0 +1,35 @@
+--TEST--
+Bug #30148 (ReflectionMethod->isConstructor() fails for inherited classes)
+--FILE--
+<?php
+
+class Root
+{
+       function Root() {}
+}
+class Base extends Root
+{
+       function __construct() {}
+}
+class Derived extends Base
+{
+}
+$a = new ReflectionMethod('Root','Root');
+$b = new ReflectionMethod('Base','Root');
+$c = new ReflectionMethod('Base','__construct');
+$d = new ReflectionMethod('Derived','Root');
+$e = new ReflectionMethod('Derived','__construct');
+var_dump($a->isConstructor());
+var_dump($b->isConstructor());
+var_dump($c->isConstructor());
+var_dump($d->isConstructor());
+var_dump($e->isConstructor());
+?>
+===DONE===
+--EXPECT--
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+===DONE===
\ No newline at end of file
diff --git a/ext/reflection/tests/bug30209.phpt b/ext/reflection/tests/bug30209.phpt
new file mode 100755 (executable)
index 0000000..8afb651
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #30209 ()
+--FILE--
+<?php
+
+class Foo
+{
+       private $name = 'testBAR';
+
+       public function testBAR()
+       {
+               try
+               {
+                       $class  = new ReflectionClass($this);
+                       var_dump($this->name);
+                       $method = $class->getMethod($this->name);
+                       var_dump($this->name);
+               }
+
+               catch (Exception $e) {}
+       }
+}
+
+$foo = new Foo;
+$foo->testBAR();
+?>
+===DONE===
+--EXPECTF--
+string(7) "testBAR"
+string(7) "testBAR"
+===DONE===