php-src/Zend/tests/traits/bugs/alias01.phpt
Stefan Marr 8ba00176f1 Fixed a inconsitent condition for aliasing traits.
- missed a failing Traits test, but is now fixed, and the bug covered by a dedicated test
# Should always comment conditions that go over more than two lines :-/
2011-05-13 20:28:34 +00:00

27 lines
357 B
PHP

--TEST--
Aliases are applied to the correct methods, and only to them.
--FILE--
<?php
trait T1 {
function m1() { echo "T:m1\n"; }
function m2() { echo "T:m2\n"; }
}
class C1 {
use T1 { m1 as a1; }
}
$o = new C1;
$o->m1();
$o->a1();
$o->m2();
$o->a2();
?>
--EXPECTF--
T:m1
T:m1
T:m2
Fatal error: Call to undefined method C1::a2() in %s on line %d