Annotation of embedaddon/php/ext/reflection/tests/ReflectionClass_constructor_002.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: ReflectionClass::__constructor() - bad arguments
        !             3: --FILE--
        !             4: <?php
        !             5: try {
        !             6:        var_dump(new ReflectionClass());
        !             7: } catch (Exception $e) {
        !             8:        echo $e->getMessage() . "\n";  
        !             9: }
        !            10: 
        !            11: try {
        !            12:        var_dump(new ReflectionClass(null));
        !            13: } catch (Exception $e) {
        !            14:        echo $e->getMessage() . "\n";  
        !            15: }
        !            16: 
        !            17: try {
        !            18:        var_dump(new ReflectionClass(true));
        !            19: } catch (Exception $e) {
        !            20:        echo $e->getMessage() . "\n";  
        !            21: }
        !            22: 
        !            23: try {
        !            24:        var_dump(new ReflectionClass(1));
        !            25: } catch (Exception $e) {
        !            26:        echo $e->getMessage() . "\n";  
        !            27: }
        !            28: 
        !            29: try {
        !            30:        var_dump(new ReflectionClass(array(1,2,3)));
        !            31: } catch (Exception $e) {
        !            32:        echo $e->getMessage() . "\n";  
        !            33: }
        !            34: 
        !            35: try {
        !            36:        var_dump(new ReflectionClass("stdClass", 1));
        !            37: } catch (Exception $e) {
        !            38:        echo $e->getMessage() . "\n";  
        !            39: }
        !            40: 
        !            41: try {
        !            42:        var_dump(new ReflectionClass("X"));
        !            43: } catch (Exception $e) {
        !            44:        echo $e->getMessage() . "\n";  
        !            45: }
        !            46: 
        !            47: ?>
        !            48: --EXPECTF--
        !            49: 
        !            50: Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in %s on line 3
        !            51: object(ReflectionClass)#%d (1) {
        !            52:   ["name"]=>
        !            53:   string(0) ""
        !            54: }
        !            55: Class  does not exist
        !            56: Class 1 does not exist
        !            57: Class 1 does not exist
        !            58: 
        !            59: Notice: Array to string conversion in %s on line 27
        !            60: Class Array does not exist
        !            61: 
        !            62: Warning: ReflectionClass::__construct() expects exactly 1 parameter, 2 given in %s on line 33
        !            63: object(ReflectionClass)#%d (1) {
        !            64:   ["name"]=>
        !            65:   string(0) ""
        !            66: }
        !            67: Class X does not exist

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>