File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / reflection / tests / bug63399.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:00 2013 UTC (11 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #63399 (ReflectionClass::getTraitAliases() incorrectly resolves traitnames)
--FILE--
<?php
trait Trait1 {
        public function run() {}
        public function say() {}
}

trait Trait2 {
        public function run() {}
        public function say() {}
}

class MyClass
{
    use Trait1, Trait2 {
        Trait1::run as execute;
        Trait1::say insteadof Trait2;
        Trait2::run insteadof Trait1;
        Trait2::say as talk;
    }
}

$ref = new ReflectionClass('MyClass');

print_r($ref->getTraitAliases());
print_r($ref->getTraits());

?>
--EXPECT--
Array
(
    [execute] => Trait1::run
    [talk] => Trait2::say
)
Array
(
    [Trait1] => ReflectionClass Object
        (
            [name] => Trait1
        )

    [Trait2] => ReflectionClass Object
        (
            [name] => Trait2
        )

)

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