Annotation of embedaddon/php/ext/standard/tests/assert/assert_error1.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: assert() - error - invalid params
        !             3: --INI--
        !             4: assert.active = 1
        !             5: assert.warning = 1
        !             6: assert.callback = f1
        !             7: assert.quiet_eval = 1
        !             8: assert.bail = 0
        !             9: --FILE--
        !            10: <?php
        !            11: function f1() 
        !            12: {
        !            13:        echo "f1 called\n";
        !            14: }
        !            15: function handler($errno, $errstr) {
        !            16:         echo "in handler()\n\n";
        !            17:         assert(E_RECOVERABLE_ERROR === $errno);
        !            18:         var_dump($errstr);
        !            19: }
        !            20: 
        !            21: //Wrong number of parameters for assert_options()
        !            22: assert_options(ASSERT_WARNING, 1);
        !            23: var_dump($rao=assert_options(ASSERT_CALLBACK,"f1",1));
        !            24: 
        !            25: 
        !            26: //Unknown option for assert_options()
        !            27: var_dump($rao=assert_options("F1","f1"));
        !            28: 
        !            29: //Wrong number of parameters for  assert()
        !            30: $sa="0 != 0";
        !            31: var_dump($r2=assert($sa,1));
        !            32: 
        !            33: 
        !            34: //Catch recoverable error with handler
        !            35: var_dump($rc=assert('aa=sd+as+safsafasfaçsafçsafç'));
        !            36: --EXPECTF--
        !            37: Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
        !            38: NULL
        !            39: 
        !            40: Warning: assert_options() expects parameter 1 to be long, string given in %s on line %d
        !            41: NULL
        !            42: 
        !            43: Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d
        !            44: NULL

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