Annotation of embedaddon/php/Zend/tests/traits/bug55424.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #55424 (Method got missing from class when a trait defined an abstract method to express a requirement)
                      3: --FILE--
                      4: <?php
                      5: 
                      6:        trait ATrait
                      7:        {
                      8:                function setRequired()
                      9:                {
                     10:                        $this->setAttribute();
                     11:                }
                     12: 
                     13:                abstract function setAttribute();
                     14:        }       
                     15: 
                     16:        class Base
                     17:        {
                     18:                function setAttribute() { }
                     19:        }
                     20: 
                     21:        class MyClass extends Base
                     22:        {
                     23:                use ATrait;
                     24:        }
                     25: 
                     26:        $i = new Base();
                     27:        $i->setAttribute();
                     28: 
                     29:        $t = new MyClass();
                     30:        /* setAttribute used to disappear for no good reason. */
                     31:        $t->setRequired();
                     32:        echo 'DONE';
                     33: ?>
                     34: --EXPECT--
                     35: DONE

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