Annotation of embedaddon/php/ext/spl/tests/arrayObject___construct_error1.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: SPL: ArrayObject::__construct with bad iterator.
        !             3: --FILE--
        !             4: <?php
        !             5: echo "Bad iterator type:\n";
        !             6: $a = new stdClass;
        !             7: $a->p = 1;
        !             8: try {
        !             9:   var_dump(new ArrayObject($a, 0, "Exception"));
        !            10: } catch (InvalidArgumentException $e) {
        !            11:   echo $e->getMessage() . "(" . $e->getLine() .  ")\n";
        !            12: }
        !            13: 
        !            14: echo "Non-existent class:\n";
        !            15: try {
        !            16:   var_dump(new ArrayObject(new stdClass, 0, "nonExistentClassName"));
        !            17: } catch (InvalidArgumentException $e) {
        !            18:   echo $e->getMessage() . "(" . $e->getLine() .  ")\n";
        !            19: }
        !            20: ?>
        !            21: --EXPECTF--
        !            22: Bad iterator type:
        !            23: ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'Exception' given(6)
        !            24: Non-existent class:
        !            25: ArrayObject::__construct() expects parameter 3 to be a class name derived from Iterator, 'nonExistentClassName' given(13)

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