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

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);
1.1.1.2 ! misho      23: var_dump($rao = assert_options(ASSERT_CALLBACK, "f1", 1));
1.1       misho      24: 
                     25: 
                     26: //Unknown option for assert_options()
1.1.1.2 ! misho      27: var_dump($rao=assert_options("F1", "f1"));
1.1       misho      28: 
                     29: //Wrong number of parameters for  assert()
                     30: $sa="0 != 0";
1.1.1.2 ! misho      31: var_dump($r2 = assert($sa, "message", 1));
1.1       misho      32: 
                     33: 
                     34: //Catch recoverable error with handler
1.1.1.2 ! misho      35: var_dump($rc = assert('aa=sd+as+safsafasfaçsafçsafç'));
1.1       misho      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: 
1.1.1.2 ! misho      43: Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
1.1       misho      44: NULL
1.1.1.2 ! misho      45: 

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