php-src/ext/standard/tests/assert/assert03.phpt
Christopher Jones 1d5dbea704 Fix INI blocks
2009-03-17 01:52:52 +00:00

40 lines
728 B
PHP

--TEST--
assert() - set callback using ini_set()
--INI--
assert.active = 1
assert.warning = 0
assert.callback =
assert.bail = 0
assert.quiet_eval = 1
--FILE--
<?php
function a($file,$line,$myev)
{
echo "assertion failed - a - $line,\"$myev\"\n";
}
function b($file,$line,$myev)
{
echo "assertion failed - b - $line,\"$myev\"\n";
}
assert_options(ASSERT_ACTIVE,1);
assert_options(ASSERT_QUIET_EVAL,1);
assert_options(ASSERT_WARNING,0);
$a = 0;
assert_options(ASSERT_CALLBACK,"a");
assert('$a != 0');
/* Modify call back using ini_set() */
ini_set("assert.callback", "b");
assert('$a != 0');
?>
==DONE==
--EXPECTF--
assertion failed - a - %d,"$a != 0"
assertion failed - b - %d,"$a != 0"
==DONE==