diff options
author | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2005-06-10 18:06:44 +0000 |
commit | 02889a1980340caaa4f2450c834da87fb675f848 (patch) | |
tree | 2e0b0f07f6810a635d5ecba89f63b6bfb63126f8 /ext/reflection/tests | |
parent | 3b1f8e9ad74ad07580e4248b39fd0db261c31aa0 (diff) | |
download | php-git-php-5.0.1b1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_5_0_1b1'.php-5.0.1b1
Diffstat (limited to 'ext/reflection/tests')
-rwxr-xr-x | ext/reflection/tests/001.phpt | 89 | ||||
-rwxr-xr-x | ext/reflection/tests/002.phpt | 63 | ||||
-rwxr-xr-x | ext/reflection/tests/003.phpt | 31 | ||||
-rwxr-xr-x | ext/reflection/tests/004.phpt | 42 | ||||
-rwxr-xr-x | ext/reflection/tests/005.phpt | 54 | ||||
-rwxr-xr-x | ext/reflection/tests/006.phpt | 103 | ||||
-rwxr-xr-x | ext/reflection/tests/bug26640.phpt | 25 | ||||
-rwxr-xr-x | ext/reflection/tests/bug26695.phpt | 25 | ||||
-rwxr-xr-x | ext/reflection/tests/bug29523.phpt | 38 | ||||
-rwxr-xr-x | ext/reflection/tests/bug29828.phpt | 35 | ||||
-rwxr-xr-x | ext/reflection/tests/bug30146.phpt | 23 | ||||
-rwxr-xr-x | ext/reflection/tests/bug30148.phpt | 35 | ||||
-rwxr-xr-x | ext/reflection/tests/bug30209.phpt | 31 | ||||
-rwxr-xr-x | ext/reflection/tests/bug30856.phpt | 20 | ||||
-rwxr-xr-x | ext/reflection/tests/bug30961.phpt | 20 | ||||
-rwxr-xr-x | ext/reflection/tests/bug31651.phpt | 24 | ||||
-rwxr-xr-x | ext/reflection/tests/bug32981.phpt | 34 | ||||
-rw-r--r-- | ext/reflection/tests/exception.inc | 16 | ||||
-rwxr-xr-x | ext/reflection/tests/parameters_001.phpt | 38 | ||||
-rwxr-xr-x | ext/reflection/tests/property_exists.phpt | 222 | ||||
-rwxr-xr-x | ext/reflection/tests/static_properties_002.phpt | 62 |
21 files changed, 0 insertions, 1030 deletions
diff --git a/ext/reflection/tests/001.phpt b/ext/reflection/tests/001.phpt deleted file mode 100755 index f68afc950e..0000000000 --- a/ext/reflection/tests/001.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -Reflection inheritance ---FILE-- -<?php - -class ReflectionClassEx extends ReflectionClass -{ - public $bla; - - function getMethodNames() - { - $res = array(); - foreach($this->getMethods() as $m) - { - $res[] = $m->class . '::' . $m->name; - } - return $res; - } -} - -$r = new ReflectionClassEx('ReflectionClassEx'); - -$exp = array ( - 'UMLClass::__clone', - 'UMLClass::export', - 'UMLClass::__construct', - 'UMLClass::__toString', - 'UMLClass::getName', - 'UMLClass::isInternal', - 'UMLClass::isUserDefined', - 'UMLClass::isInstantiable', - 'UMLClass::getFileName', - 'UMLClass::getStartLine', - 'UMLClass::getEndLine', - 'UMLClass::getDocComment', - 'UMLClass::getConstructor', - 'UMLClass::getMethod', - 'UMLClass::getMethods', - 'UMLClass::getProperty', - 'UMLClass::getProperties', - 'UMLClass::getConstants', - 'UMLClass::getConstant', - 'UMLClass::getInterfaces', - 'UMLClass::isInterface', - 'UMLClass::isAbstract', - 'UMLClass::isFinal', - 'UMLClass::getModifiers', - 'UMLClass::isInstance', - 'UMLClass::newInstance', - 'UMLClass::getParentClass', - 'UMLClass::isSubclassOf', - 'UMLClass::getStaticProperties', - 'UMLClass::getDefaultProperties', - 'UMLClass::isIterateable', - 'UMLClass::implementsInterface', - 'UMLClass::getExtension', - 'UMLClass::getExtensionName'); - -$miss = array(); - -$res = $r->getMethodNames(); - -foreach($exp as $m) -{ - if (!in_array($m, $exp)) - { - $miss[] = $m; - } -} - -var_dump($miss); - -$props = array_keys(get_class_vars('ReflectionClassEx')); -sort($props); -var_dump($props); -var_dump($r->name); -?> -===DONE=== ---EXPECT-- -array(0) { -} -array(2) { - [0]=> - string(3) "bla" - [1]=> - string(4) "name" -} -string(17) "ReflectionClassEx" -===DONE=== diff --git a/ext/reflection/tests/002.phpt b/ext/reflection/tests/002.phpt deleted file mode 100755 index 195aeb23e7..0000000000 --- a/ext/reflection/tests/002.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Reflection properties are read only ---FILE-- -<?php - -class ReflectionMethodEx extends ReflectionMethod -{ - public $foo = "xyz"; - - function __construct($c,$m) - { - echo __METHOD__ . "\n"; - parent::__construct($c,$m); - } -} - -$r = new ReflectionMethodEx('ReflectionMethodEx','getName'); - -var_dump($r->class); -var_dump($r->name); -var_dump($r->foo); -@var_dump($r->bar); - -try -{ - $r->class = 'bullshit'; -} -catch(ReflectionException $e) -{ - echo $e->getMessage() . "\n"; -} -try -{ -$r->name = 'bullshit'; -} -catch(ReflectionException $e) -{ - echo $e->getMessage() . "\n"; -} - -$r->foo = 'bar'; -$r->bar = 'baz'; - -var_dump($r->class); -var_dump($r->name); -var_dump($r->foo); -var_dump($r->bar); - -?> -===DONE=== ---EXPECTF-- -ReflectionMethodEx::__construct -string(18) "ReflectionMethodEx" -string(7) "getName" -string(3) "xyz" -NULL -Cannot set read-only property ReflectionMethodEx::$class -Cannot set read-only property ReflectionMethodEx::$name -string(18) "ReflectionMethodEx" -string(7) "getName" -string(3) "bar" -string(3) "baz" -===DONE=== diff --git a/ext/reflection/tests/003.phpt b/ext/reflection/tests/003.phpt deleted file mode 100755 index 6603892559..0000000000 --- a/ext/reflection/tests/003.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -invoke() with base class method ---FILE-- -<?php - -class Foo -{ - function Test() - { - echo __METHOD__ . "\n"; - } -} - -class Bar extends Foo -{ - function Test() - { - echo __METHOD__ . "\n"; - } -} - -$o = new Bar; -$r = new ReflectionMethod('Foo','Test'); - -$r->invoke($o); - -?> -===DONE=== ---EXPECT-- -Foo::Test -===DONE=== diff --git a/ext/reflection/tests/004.phpt b/ext/reflection/tests/004.phpt deleted file mode 100755 index c5a243be6f..0000000000 --- a/ext/reflection/tests/004.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -invoke() with non object or null value ---FILE-- -<?php - -class a { - function a(){ - } -} -class b { -} - -$b = new b(); - -$a=new ReflectionClass("a"); -$m=$a->getMethod("a"); - -try { - $m->invoke(null); -} catch (ReflectionException $E) { - echo $E->getMessage()."\n"; -} - - -try { - $m->invoke($b); -} catch (ReflectionException $E) { - echo $E->getMessage()."\n"; -} - -$b = new a(); -try { - $m->invoke($b); -} catch (ReflectionException $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=== diff --git a/ext/reflection/tests/005.phpt b/ext/reflection/tests/005.phpt deleted file mode 100755 index f337e44ae6..0000000000 --- a/ext/reflection/tests/005.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -ReflectionMethod::getDocComment() uses wrong comment block ---FILE-- -<?php - -function strip_doc_comment($c) -{ - if (!strlen($c) || $c === false) return $c; - return trim(substr($c, 3, -2)); -} - -/** Comment for class A */ -class A -{ - /** Method A::bla() - */ - function bla() - { - } - - function foo() { - /** - * This is a valid comment inside a method - */ - } - - function bar() { - // I don't have a doc comment.... - } - - /** - * Comment for A::baz() - */ - function baz() { - } -} - -$r = new ReflectionClass('A'); -var_dump(strip_doc_comment($r->getDocComment())); - -foreach($r->getMethods() as $m) -{ - var_dump(strip_doc_comment($m->getDocComment())); -} - -?> -===DONE=== ---EXPECT-- -string(19) "Comment for class A" -string(15) "Method A::bla()" -bool(false) -bool(false) -string(22) "* Comment for A::baz()" -===DONE=== diff --git a/ext/reflection/tests/006.phpt b/ext/reflection/tests/006.phpt deleted file mode 100755 index 89c438765a..0000000000 --- a/ext/reflection/tests/006.phpt +++ /dev/null @@ -1,103 +0,0 @@ ---TEST-- -ReflectionClass::[gs]etStaticPropertyValue ---FILE-- -<?php - -/* ReflectionClass cannot touch protected or private static properties */ - -/* ReflectionClass cannot create or delete static properties */ - -Class Test -{ - static public $pub = 'pub'; - static protected $pro = 'pro'; - static private $pri = 'pri'; - - static function testing() - { - $ref = new ReflectionClass('Test'); - - foreach(array('pub', 'pro', 'pri') as $name) - { - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } - } - } -} - -Class TestDerived extends Test -{ -// static public $pub = 'pub'; -// static protected $pro = 'pro'; - static private $pri = 'pri'; - - static function testing() - { - $ref = new ReflectionClass('Test'); - - foreach(array('pub', 'pro', 'pri') as $name) - { - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } - } - } -} - -$ref = new ReflectionClass('Test'); - -foreach(array('pub', 'pro', 'pri') as $name) -{ - try - { - var_dump($ref->getStaticPropertyValue($name)); - var_dump($ref->getStaticPropertyValue($name)); - $ref->setStaticPropertyValue($name, 'updated'); - var_dump($ref->getStaticPropertyValue($name)); - } - catch(Exception $e) - { - echo "EXCEPTION\n"; - } -} - -Test::testing(); -TestDerived::testing(); - -?> -===DONE=== -<?php exit(0); ?> ---EXPECT-- -string(3) "pub" -string(3) "pub" -string(7) "updated" -EXCEPTION -EXCEPTION -string(7) "updated" -string(7) "updated" -string(7) "updated" -EXCEPTION -EXCEPTION -string(7) "updated" -string(7) "updated" -string(7) "updated" -EXCEPTION -EXCEPTION -===DONE=== diff --git a/ext/reflection/tests/bug26640.phpt b/ext/reflection/tests/bug26640.phpt deleted file mode 100755 index 2cbd0d23d4..0000000000 --- a/ext/reflection/tests/bug26640.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26640 (__autoload() not invoked by Reflection classes) ---FILE-- -<?php - -function __autoload($c) -{ - class autoload_class - { - public function __construct() - { - print "autoload success\n"; - } - } -} - -$a = new ReflectionClass('autoload_class'); - -if (is_object($a)) { - echo "OK\n"; -} - -?> ---EXPECT-- -OK diff --git a/ext/reflection/tests/bug26695.phpt b/ext/reflection/tests/bug26695.phpt deleted file mode 100755 index 859168f6ae..0000000000 --- a/ext/reflection/tests/bug26695.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Bug #26695 (Reflection API does not recognize mixed-case class hints) ---FILE-- -<?php - -class Foo { -} - -class Bar { - function demo(foo $f) { - } -} - -$class = new ReflectionClass('bar'); -$methods = $class->getMethods(); -$params = $methods[0]->getParameters(); - -$class = $params[0]->getClass(); - -var_dump($class->getName()); -?> -===DONE=== ---EXPECT-- -string(3) "Foo" -===DONE===
\ No newline at end of file diff --git a/ext/reflection/tests/bug29523.phpt b/ext/reflection/tests/bug29523.phpt deleted file mode 100755 index 01c83c2a15..0000000000 --- a/ext/reflection/tests/bug29523.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Bug #29523 (ReflectionParameter::isOptional() is incorrect) ---FILE-- -<?php - -class TestClass -{ -} - -function optionalTest(TestClass $a, TestClass $b, $c = 3) -{ -} - -$function = new ReflectionFunction('optionalTest'); -$numberOfNotOptionalParameters = 0; -$numberOfOptionalParameters = 0; -foreach($function->getParameters() as $parameter) -{ - var_dump($parameter->isOptional()); - if ($parameter->isOptional()) - { - ++$numberOfOptionalParameters; - } - else - { - ++$numberOfNotOptionalParameters; - } -} -var_dump($function->getNumberOfRequiredParameters()); -var_dump($numberOfNotOptionalParameters); - -?> ---EXPECT-- -bool(false) -bool(false) -bool(true) -int(2) -int(2) diff --git a/ext/reflection/tests/bug29828.phpt b/ext/reflection/tests/bug29828.phpt deleted file mode 100755 index b82be39f98..0000000000 --- a/ext/reflection/tests/bug29828.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Bug #29828 (Interfaces no longer work) ---FILE-- -<?php - -interface Bla -{ - function bla(); -} - -class BlaMore implements Bla -{ - function bla() - { - echo "Hello\n"; - } -} - -$r = new ReflectionClass('BlaMore'); - -var_dump(count($r->getMethods())); -var_dump($r->getMethod('bla')->isConstructor()); -var_dump($r->getMethod('bla')->isAbstract()); - -$o=new BlaMore; -$o->bla(); - -?> -===DONE=== ---EXPECT-- -int(1) -bool(false) -bool(false) -Hello -===DONE=== diff --git a/ext/reflection/tests/bug30146.phpt b/ext/reflection/tests/bug30146.phpt deleted file mode 100755 index 4f48985dcc..0000000000 --- a/ext/reflection/tests/bug30146.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---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 deleted file mode 100755 index c3bfd0611f..0000000000 --- a/ext/reflection/tests/bug30148.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---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 deleted file mode 100755 index 6705c6704d..0000000000 --- a/ext/reflection/tests/bug30209.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Bug #30209 (ReflectionClass::getMethod() lowercases attribute) ---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=== diff --git a/ext/reflection/tests/bug30856.phpt b/ext/reflection/tests/bug30856.phpt deleted file mode 100755 index 2963263388..0000000000 --- a/ext/reflection/tests/bug30856.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #30856 (ReflectionClass::getStaticProperties segfaults) ---FILE-- -<? -class bogus { - const C = 'test'; - static $a = bogus::C; -} - -$class = new ReflectionClass('bogus'); - -var_dump($class->getStaticProperties()); -?> -===DONE=== ---EXPECT-- -array(1) { - ["a"]=> - string(4) "test" -} -===DONE=== diff --git a/ext/reflection/tests/bug30961.phpt b/ext/reflection/tests/bug30961.phpt deleted file mode 100755 index 78067471d4..0000000000 --- a/ext/reflection/tests/bug30961.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) ---FILE-- -<? - class a - { - } - - class b extends a - { - } - - $ref1 = new ReflectionClass('a'); - $ref2 = new ReflectionClass('b'); - echo $ref1->getStartLine() . "\n"; - echo $ref2->getStartLine() . "\n"; -?> ---EXPECT-- -2 -6 diff --git a/ext/reflection/tests/bug31651.phpt b/ext/reflection/tests/bug31651.phpt deleted file mode 100755 index 60bee14e9f..0000000000 --- a/ext/reflection/tests/bug31651.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Bug #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) ---FILE-- -<?php - -class Test -{ - public $a = array('a' => 1); -} - -$ref = new ReflectionClass('Test'); - -print_r($ref->getDefaultProperties()); - -?> ---EXPECT-- -Array -( - [a] => Array - ( - [a] => 1 - ) - -) diff --git a/ext/reflection/tests/bug32981.phpt b/ext/reflection/tests/bug32981.phpt deleted file mode 100755 index 298756e147..0000000000 --- a/ext/reflection/tests/bug32981.phpt +++ /dev/null @@ -1,34 +0,0 @@ ---TEST-- -Bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault) ---FILE-- -<?php - -class TestClass -{ - static function test() - { - static $enabled = true; - } -} - -$class = new ReflectionClass('TestClass'); -foreach ($class->getMethods() as $method) -{ - var_dump($method->getName()); - $arr_static_vars[] = $method->getStaticVariables(); -} - -var_dump($arr_static_vars); - -?> -===DONE=== ---EXPECT-- -string(4) "test" -array(1) { - [0]=> - array(1) { - ["enabled"]=> - UNKNOWN:0 - } -} -===DONE=== diff --git a/ext/reflection/tests/exception.inc b/ext/reflection/tests/exception.inc deleted file mode 100644 index e403339965..0000000000 --- a/ext/reflection/tests/exception.inc +++ /dev/null @@ -1,16 +0,0 @@ -<?php -class ReflectionExceptionEx extends ReflectionException { - function MyException($_errno, $_errmsg) { - $this->errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } -} -?> diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt deleted file mode 100755 index 709944677f..0000000000 --- a/ext/reflection/tests/parameters_001.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -Check for parameter being optional ---FILE-- -<?php - -class Test { - function func($x, $y = NULL){ - } -} - - -$f = new ReflectionMethod('Test', 'func'); -var_dump($f->getNumberOfParameters()); -var_dump($f->getNumberOfRequiredParameters()); - -$p = new ReflectionParameter(array('Test', 'func'), 'x'); -var_dump($p->isOptional()); - -$p = new ReflectionParameter(array('Test', 'func'), 'y'); -var_dump($p->isOptional()); - -try { - $p = new ReflectionParameter(array('Test', 'func'), 'z'); - var_dump($p->isOptional()); -} -catch (Exception $e) { - var_dump($e->getMessage()); -} - -?> -===DONE=== ---EXPECT-- -int(2) -int(1) -bool(false) -bool(true) -string(54) "The parameter specified by its name could not be found" -===DONE=== diff --git a/ext/reflection/tests/property_exists.phpt b/ext/reflection/tests/property_exists.phpt deleted file mode 100755 index fa712dfdbe..0000000000 --- a/ext/reflection/tests/property_exists.phpt +++ /dev/null @@ -1,222 +0,0 @@ ---TEST-- -ZE2 property_exists() ---FILE-- -<?php - -class A -{ - public $a = 1; - protected $b = 2; - private $c = 3; - - public $empty; - public $init = 1; - - function __toString() - { - return 'obj(' . get_class($this) . ')'; - } - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -class B extends A -{ - private $c = 4; - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -class C extends B -{ - private $d = 5; - - static function test($oc, $props) - { - echo '===' . __CLASS__ . "===\n"; - foreach($props as $p2) { - echo $oc, '::$' , $p2, "\n"; - var_dump(property_exists($oc, $p2)); - } - } -} - -$oA = new A; -$oA->e = 6; - -$oC = new C; - -$pc = array($oA, 'A', 'B', 'C', $oC); -$pr = array('a', 'b', 'c', 'd', 'e'); - -foreach($pc as $p1) { - if (is_object($p1)) { - $p1->test($p1, $pr); - } else { - $r = new ReflectionMethod($p1, 'test'); - $r->invoke(NULL, $p1, $pr); - } - echo "===GLOBAL===\n"; - foreach($pr as $p2) { - echo $p1, '::$' , $p2, "\n"; - var_dump(property_exists($p1, $p2)); - } -} - -echo "===PROBLEMS===\n"; -var_dump(property_exists(NULL, 'empty')); -var_dump(property_exists(25,'empty')); -var_dump(property_exists('','')); -var_dump(property_exists('A','')); -var_dump(property_exists('A','123')); -var_dump(property_exists('A','init')); -var_dump(property_exists('A','empty')); -var_dump(property_exists(new A, '')); -var_dump(property_exists(new A, '123')); -var_dump(property_exists(new A, 'init')); -var_dump(property_exists(new A, 'empty')); -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -===A=== -obj(A)::$a -bool(true) -obj(A)::$b -bool(true) -obj(A)::$c -bool(true) -obj(A)::$d -bool(false) -obj(A)::$e -bool(true) -===GLOBAL=== -obj(A)::$a -bool(true) -obj(A)::$b -bool(false) -obj(A)::$c -bool(false) -obj(A)::$d -bool(false) -obj(A)::$e -bool(true) -===A=== -A::$a -bool(true) -A::$b -bool(true) -A::$c -bool(true) -A::$d -bool(false) -A::$e -bool(false) -===GLOBAL=== -A::$a -bool(true) -A::$b -bool(false) -A::$c -bool(false) -A::$d -bool(false) -A::$e -bool(false) -===B=== -B::$a -bool(true) -B::$b -bool(true) -B::$c -bool(true) -B::$d -bool(false) -B::$e -bool(false) -===GLOBAL=== -B::$a -bool(true) -B::$b -bool(false) -B::$c -bool(false) -B::$d -bool(false) -B::$e -bool(false) -===C=== -C::$a -bool(true) -C::$b -bool(true) -C::$c -bool(false) -C::$d -bool(true) -C::$e -bool(false) -===GLOBAL=== -C::$a -bool(true) -C::$b -bool(false) -C::$c -bool(false) -C::$d -bool(false) -C::$e -bool(false) -===C=== -obj(C)::$a -bool(true) -obj(C)::$b -bool(true) -obj(C)::$c -bool(false) -obj(C)::$d -bool(true) -obj(C)::$e -bool(false) -===GLOBAL=== -obj(C)::$a -bool(true) -obj(C)::$b -bool(false) -obj(C)::$c -bool(false) -obj(C)::$d -bool(false) -obj(C)::$e -bool(false) -===PROBLEMS=== - -Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists.php on line %d -NULL - -Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists.php on line %d -NULL -bool(false) -bool(false) -bool(false) -bool(true) -bool(true) -bool(false) -bool(false) -bool(true) -bool(true) -===DONE=== diff --git a/ext/reflection/tests/static_properties_002.phpt b/ext/reflection/tests/static_properties_002.phpt deleted file mode 100755 index 29b84a8e65..0000000000 --- a/ext/reflection/tests/static_properties_002.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -ZE2 Inheriting static properties ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -class base { - static protected $prop = 2; - - static function show() { - echo __METHOD__ . '(' . self::$prop . ")\n"; - } - - static function inc() { - base::$prop++; - echo __METHOD__ . "()\n"; - } -} - -class derived extends base { - static public $prop; - - static function show() { - echo __METHOD__ . '(' . self::$prop . ")\n"; - } - - static function inc() { - derived::$prop++; - echo __METHOD__ . "()\n"; - } -} - -base::show(); -derived::show(); - -base::inc(); - -base::show(); -derived::show(); - -derived::inc(); - -base::show(); -derived::show(); - -$r = new ReflectionClass('derived'); -echo 'Number of properties: '. count($r->getStaticProperties()) . "\n"; - -echo "Done\n"; -?> ---EXPECTF-- -base::show(2) -derived::show(2) -base::inc() -base::show(3) -derived::show(3) -derived::inc() -base::show(4) -derived::show(4) -Number of properties: 1 -Done |