diff options
| author | Zoe Slattery <zoe@php.net> | 2007-07-09 13:13:34 +0000 |
|---|---|---|
| committer | Zoe Slattery <zoe@php.net> | 2007-07-09 13:13:34 +0000 |
| commit | 6873ee88670123264a051ae44e775f3c3182d005 (patch) | |
| tree | 8ff9a06906b1e89882b466dc659efc209045c205 /ext/reflection/tests/reflectionClass_constructor_001.phpt | |
| parent | eb45a0f7d7fb1b5420e7bbcd7b30e8a1506dd09d (diff) | |
| download | php-git-6873ee88670123264a051ae44e775f3c3182d005.tar.gz | |
ReflectionClass constructor tests
Diffstat (limited to 'ext/reflection/tests/reflectionClass_constructor_001.phpt')
| -rw-r--r-- | ext/reflection/tests/reflectionClass_constructor_001.phpt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/reflection/tests/reflectionClass_constructor_001.phpt b/ext/reflection/tests/reflectionClass_constructor_001.phpt new file mode 100644 index 0000000000..5d365c8a9a --- /dev/null +++ b/ext/reflection/tests/reflectionClass_constructor_001.phpt @@ -0,0 +1,46 @@ +--TEST-- +ReflectionClass::__constructor() +--FILE-- +<?php +$r1 = new ReflectionClass("stdClass"); + +$myInstance = new stdClass; +$r2 = new ReflectionClass($myInstance); + +class TrickClass { + function __toString() { + //Return the name of another class + return "Exception"; + } +} +$myTrickClass = new TrickClass; +$r3 = new ReflectionClass($myTrickClass); + +var_dump($r1, $r2, $r3); +?> +--EXPECTF-- +object(ReflectionClass)#%d (1) { + ["name"]=> + string(8) "stdClass" +} +object(ReflectionClass)#%d (1) { + ["name"]=> + string(8) "stdClass" +} +object(ReflectionClass)#%d (1) { + ["name"]=> + string(10) "TrickClass" +} +--UEXPECTF-- +object(ReflectionClass)#%d (1) { + [u"name"]=> + unicode(8) "stdClass" +} +object(ReflectionClass)#%d (1) { + [u"name"]=> + unicode(8) "stdClass" +} +object(ReflectionClass)#%d (1) { + [u"name"]=> + unicode(10) "TrickClass" +} |
