diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
commit | 0a36161e13484a99ccf69bb38f206462d27cc6d6 (patch) | |
tree | d5107db4b7369603ac7c753829e8972ee74949f7 /tests | |
parent | ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (diff) | |
download | php-0a36161e13484a99ccf69bb38f206462d27cc6d6.tar.gz |
Imported Upstream version 5.1.2upstream/5.1.2
Diffstat (limited to 'tests')
27 files changed, 137 insertions, 967 deletions
diff --git a/tests/classes/__set_data_corrupt.phpt b/tests/classes/__set_data_corrupt.phpt index 86c39243d..6a52bd489 100644 --- a/tests/classes/__set_data_corrupt.phpt +++ b/tests/classes/__set_data_corrupt.phpt @@ -1,5 +1,5 @@ --TEST-- -Data corruption in __set +ZE2 Data corruption in __set --SKIPIF-- <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?> --FILE-- diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt index c3dee3f5c..206d9d540 100755 --- a/tests/classes/array_access_013.phpt +++ b/tests/classes/array_access_013.phpt @@ -1,5 +1,5 @@ --TEST-- -ZE2 arrayAcces & exceptions +ZE2 ArrayAccess and exceptions --FILE-- <?php diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt index 64d68ba8a..ca13990c9 100644 --- a/tests/classes/bug27504.phpt +++ b/tests/classes/bug27504.phpt @@ -20,5 +20,6 @@ Bug #27504 (call_user_func_array allows calling of private/protected methods) --EXPECTF-- Called function foo:bar(%d) -Fatal error: Call to private method foo::bar() from context '' in %s on line 13 +Warning: call_user_func_array(): First argument is expected to be a valid callback, 'foo::bar' was given in %sbug27504.php on line %d +Fatal error: Call to private method foo::bar() from context '' in %s on line %d diff --git a/tests/classes/destructor_and_echo.phpt b/tests/classes/destructor_and_echo.phpt index c6c6f23a7..0a253593a 100755 --- a/tests/classes/destructor_and_echo.phpt +++ b/tests/classes/destructor_and_echo.phpt @@ -1,5 +1,5 @@ --TEST-- -Destructors and echo +ZE2 Destructors and echo --FILE-- <?php diff --git a/tests/classes/destructor_and_references.phpt b/tests/classes/destructor_and_references.phpt index 66e8b41f7..6b9b019b6 100755 --- a/tests/classes/destructor_and_references.phpt +++ b/tests/classes/destructor_and_references.phpt @@ -1,5 +1,5 @@ --TEST-- -Destructing and references +ZE2 Destructing and references --FILE-- <?php @@ -23,4 +23,4 @@ $o = new once; echo "Done\n"; ?> --EXPECT-- -Done
\ No newline at end of file +Done diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt new file mode 100755 index 000000000..ebfa08081 --- /dev/null +++ b/tests/classes/final_ctor1.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 cannot override final __construct +--FILE-- +<?php + +class Base +{ + public final function __construct() + { + } +} + +class Works extends Base +{ +} + +class Extended extends Base +{ + public function Extended() + { + } +} + +ReflectionClass::export('Extended'); + +?> +--EXPECTF-- + +Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt new file mode 100755 index 000000000..905337b40 --- /dev/null +++ b/tests/classes/final_ctor2.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 cannot override final old style ctor +--FILE-- +<?php + +class Base +{ + public final function Base() + { + } +} + +class Works extends Base +{ +} + +class Extended extends Base +{ + public function __construct() + { + } +} + +ReflectionClass::export('Extended'); + +?> +--EXPECTF-- + +Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d diff --git a/tests/classes/property_exists.phpt b/tests/classes/property_exists.phpt deleted file mode 100755 index fa712dfdb..000000000 --- a/tests/classes/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/tests/classes/static_properties_002.phpt b/tests/classes/static_properties_002.phpt deleted file mode 100755 index 29b84a8e6..000000000 --- a/tests/classes/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 diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt index 12f4b6389..91b028719 100755 --- a/tests/classes/static_this.phpt +++ b/tests/classes/static_this.phpt @@ -1,5 +1,5 @@ --TEST-- -$this can be an argument to a static function +ZE2 $this can be an argument to a static function --FILE-- <?php diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt index 3cd3c4a59..eb208cf56 100755 --- a/tests/lang/bug24640.phpt +++ b/tests/lang/bug24640.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #24640 (var_export and var_dump can't output large float) +--INI-- +precision=12 --FILE-- <?php function test($v) @@ -19,7 +21,20 @@ test(1.7e+80); test(1.7e-80); test(1.7e+81); test(1.7e-81); +test(1.7e+319); +test(1.7e-319); +test(1.7e+320); +test(1.7e-320); +test(1.7e+321); +test(1.7e-321); +test(1.7e+324); +test(1.7e-324); +test(1.7e+1000); +test(1.7e-1000); + ?> +===DONE=== +<?php exit(0); ?> --EXPECT-- 1.7E+300 float(1.7E+300) @@ -61,3 +76,54 @@ float(1.7E-81) 1.7E-81 1.7E-81 ------ +INF +float(INF) +INF +INF +------ +1.69998107421E-319 +float(1.69998107421E-319) +1.69998107421E-319 +1.69998107421E-319 +------ +INF +float(INF) +INF +INF +------ +1.70007988734E-320 +float(1.70007988734E-320) +1.70007988734E-320 +1.70007988734E-320 +------ +INF +float(INF) +INF +INF +------ +1.69958582169E-321 +float(1.69958582169E-321) +1.69958582169E-321 +1.69958582169E-321 +------ +INF +float(INF) +INF +INF +------ +0 +float(0) +0 +0 +------ +INF +float(INF) +INF +INF +------ +0 +float(0) +0 +0 +------ +===DONE=== diff --git a/tests/lang/bug26640.phpt b/tests/lang/bug26640.phpt deleted file mode 100755 index 2cbd0d23d..000000000 --- a/tests/lang/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/tests/lang/bug32924.phpt b/tests/lang/bug32924.phpt index ddb8301e3..d72b0eaa2 100644 --- a/tests/lang/bug32924.phpt +++ b/tests/lang/bug32924.phpt @@ -1,12 +1,12 @@ --TEST-- Bug #32924 (prepend does not add file to included files) --INI-- -include_path=. -auto_prepend_file=tests/lang/inc.inc +include_path={PWD} +auto_prepend_file=inc.inc --FILE-- <?php -include_once('tests/lang/inc.inc'); -require_once('tests/lang/inc.inc'); +include_once(dirname(__FILE__).'/inc.inc'); +require_once(dirname(__FILE__).'/inc.inc'); ?> END --EXPECT-- diff --git a/tests/lang/bug35382.phpt b/tests/lang/bug35382.phpt index 1bd525ffb..69190d4c9 100755 --- a/tests/lang/bug35382.phpt +++ b/tests/lang/bug35382.phpt @@ -1,6 +1,6 @@ --TEST-- Bug #35382 (Comment in end of file produces fatal error) ---FILE-- +--FILEEOF-- <?php eval("echo 'Hello'; // comment"); echo " World"; diff --git a/tests/reflection/001.phpt b/tests/reflection/001.phpt deleted file mode 100755 index 6a9d31a30..000000000 --- a/tests/reflection/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/tests/reflection/002.phpt b/tests/reflection/002.phpt deleted file mode 100755 index bef4c8166..000000000 --- a/tests/reflection/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/tests/reflection/003.phpt b/tests/reflection/003.phpt deleted file mode 100755 index 660389255..000000000 --- a/tests/reflection/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/tests/reflection/004.phpt b/tests/reflection/004.phpt deleted file mode 100755 index f8a448e6c..000000000 --- a/tests/reflection/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/tests/reflection/005.phpt b/tests/reflection/005.phpt deleted file mode 100755 index f337e44ae..000000000 --- a/tests/reflection/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/tests/reflection/006.phpt b/tests/reflection/006.phpt deleted file mode 100755 index 89c438765..000000000 --- a/tests/reflection/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/tests/reflection/bug30146.phpt b/tests/reflection/bug30146.phpt deleted file mode 100755 index 72c6d2e5f..000000000 --- a/tests/reflection/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/tests/reflection/bug30148.phpt b/tests/reflection/bug30148.phpt deleted file mode 100755 index bc4415bfd..000000000 --- a/tests/reflection/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/tests/reflection/bug30209.phpt b/tests/reflection/bug30209.phpt deleted file mode 100755 index 6705c6704..000000000 --- a/tests/reflection/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/tests/reflection/bug31651.phpt b/tests/reflection/bug31651.phpt deleted file mode 100755 index 60bee14e9..000000000 --- a/tests/reflection/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/tests/reflection/bug33389.phpt b/tests/reflection/bug33389.phpt deleted file mode 100755 index 36f7079e2..000000000 --- a/tests/reflection/bug33389.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Bug #33389 (double free() when exporting a ReflectionClass) ---FILE-- -<?php -define ('foobar', 1); -class Test { - function foo1($arg=foobar) { - } - function foo2($arg=null) { - } - function foo3($arg=false) { - } - function foo4($arg='foo') { - } - function foo5($arg=1) { - } - function bar($arg) { - } - function foo() { - } -} -Reflection::export(new ReflectionClass('Test')); -?> -===DONE=== -<?php exit(0); ?> ---EXPECTF-- -Class [ <user> class Test ] { - @@ %sbug33389.php 3-18 - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [7] { - Method [ <user> public method foo1 ] { - @@ %sbug33389.php 4 - 5 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 1 ] - } - } - - Method [ <user> public method foo2 ] { - @@ %sbug33389.php 6 - 7 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = NULL ] - } - } - - Method [ <user> public method foo3 ] { - @@ %sbug33389.php 8 - 9 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = false ] - } - } - - Method [ <user> public method foo4 ] { - @@ %sbug33389.php 10 - 11 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 'foo' ] - } - } - - Method [ <user> public method foo5 ] { - @@ %sbug33389.php 12 - 13 - - - Parameters [1] { - Parameter #0 [ <optional> $arg = 1 ] - } - } - - Method [ <user> public method bar ] { - @@ %sbug33389.php 14 - 15 - - - Parameters [1] { - Parameter #0 [ <required> $arg ] - } - } - - Method [ <user> public method foo ] { - @@ %sbug33389.php 16 - 17 - } - } -} - -===DONE=== diff --git a/tests/reflection/exception.inc b/tests/reflection/exception.inc deleted file mode 100644 index e40333996..000000000 --- a/tests/reflection/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/tests/reflection/parameters_001.phpt b/tests/reflection/parameters_001.phpt deleted file mode 100755 index 0879756ea..000000000 --- a/tests/reflection/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===
|