Annotation of embedaddon/php/Zend/tests/traits/bug55355.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #55355 (Abstract functions required by a trait are not correctly found when implemented in an ancestor class)
! 3: --FILE--
! 4: <?php
! 5:
! 6: // A trait that has a abstract function
! 7: trait ATrait {
! 8: function bar() {
! 9: $this->foo();
! 10: }
! 11: abstract function foo();
! 12: }
! 13:
! 14: // A class on the second level in the
! 15: // inheritance chain
! 16: class Level2Impl {
! 17: function foo() {}
! 18: }
! 19:
! 20: class Level1Indirect extends Level2Impl {}
! 21:
! 22: // A class on the first level in the
! 23: // inheritance chain
! 24: class Level1Direct {
! 25: function foo() {}
! 26: }
! 27:
! 28: // Trait Uses
! 29:
! 30: class Direct {
! 31: use ATrait;
! 32: function foo() {}
! 33: }
! 34:
! 35: class BaseL2 extends Level1Indirect {
! 36: use ATrait;
! 37: }
! 38:
! 39: class BaseL1 extends Level1Direct {
! 40: use ATrait;
! 41: }
! 42:
! 43: echo 'DONE';
! 44: ?>
! 45: --EXPECT--
! 46: DONE
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>