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

1.1     ! misho       1: --TEST--
        !             2: ReflectionClass and Traits
        !             3: --FILE--
        !             4: <?php
        !             5: trait Foo {
        !             6:     public function someMethod() { }
        !             7: }
        !             8: 
        !             9: class Bar {
        !            10:     use Foo;
        !            11: 
        !            12:     public function someOtherMethod() { }
        !            13: }
        !            14: 
        !            15: $rFoo = new ReflectionClass('Foo');
        !            16: $rBar = new ReflectionClass('Bar');
        !            17: 
        !            18: var_dump($rFoo->isTrait());
        !            19: var_dump($rBar->isTrait());
        !            20: echo $rFoo;
        !            21: echo $rBar;
        !            22: --EXPECTF--
        !            23: bool(true)
        !            24: bool(false)
        !            25: Trait [ <user> trait Foo ] {
        !            26:   @@ %straits001.php 2-4
        !            27: 
        !            28:   - Constants [0] {
        !            29:   }
        !            30: 
        !            31:   - Static properties [0] {
        !            32:   }
        !            33: 
        !            34:   - Static methods [0] {
        !            35:   }
        !            36: 
        !            37:   - Properties [0] {
        !            38:   }
        !            39: 
        !            40:   - Methods [1] {
        !            41:     Method [ <user> public method someMethod ] {
        !            42:       @@ %straits001.php 3 - 3
        !            43:     }
        !            44:   }
        !            45: }
        !            46: Class [ <user> class Bar ] {
        !            47:   @@ %straits001.php 6-10
        !            48: 
        !            49:   - Constants [0] {
        !            50:   }
        !            51: 
        !            52:   - Static properties [0] {
        !            53:   }
        !            54: 
        !            55:   - Static methods [0] {
        !            56:   }
        !            57: 
        !            58:   - Properties [0] {
        !            59:   }
        !            60: 
        !            61:   - Methods [2] {
        !            62:     Method [ <user> public method someOtherMethod ] {
        !            63:       @@ %straits001.php 9 - 9
        !            64:     }
        !            65: 
        !            66:     Method [ <user> public method someMethod ] {
        !            67:       @@ %straits001.php 3 - 3
        !            68:     }
        !            69:   }
        !            70: }

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