Hi

I started to look at the test coverage of the Zend engine this week. I tried to commit a couple of small tests (see PHP6 versions below) but looks like my CVS ID doesn't let me commit to Zend/tests.

Would it be possible to upgrade me so that I can commit tests to Zend/tests as well as ext/standard/tests?

The tests I wanted to add were to check when class constants get initialised, I think this behaviour changed recently in PHP5 (the second test used to have output 'string(10) "const in B"'). The current behaviour looks correct and I couldn't see a test that already covers this.

selfParent_001.phpt
==============

--TEST--
Test when constants are initialised. See also selfParent_002.phpt.
--FILE--
<?php
class A {
     const myConst = "const in A";
const myDynConst = self::myConst;
     public static function test() {
           var_dump(self::myDynConst);
     }
}

class B extends A {
     const myConst = "const in B";

     public static function test() {
           var_dump(parent::myDynConst);
     }
}

A::test();
B::test();
?>
--EXPECT--
string(10) "const in A"
string(10) "const in A"
--UEXPECT--
unicode(10) "const in A"
unicode(10) "const in A"

selfParent_002.phpt
==============

--TEST--
Test when constants are initialised. See also selfParent_001.phpt.
--FILE--
<?php
class A {
     const myConst = "const in A";
const myDynConst = self::myConst;
     public static function test() {
           var_dump(self::myDynConst);
     }
}
class B extends A {
     const myConst = "const in B";

     public static function test() {
           var_dump(parent::myDynConst);
     }
}
B::test();
A::test();
?>
--EXPECT--
string(10) "const in A"
string(10) "const in A"
--UEXPECT--
unicode(10) "const in A"
unicode(10) "const in A"

Zoe Slattery
IBM

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to