Browse Source

add tests for fixed bugs

PECL_4_3
Stanislav Malyshev 23 years ago
parent
commit
91ec828de5
  1. 18
      tests/lang/bug18872.phpt
  2. 16
      tests/lang/bug23279.phpt
  3. 30
      tests/lang/bug23384.phpt

18
tests/lang/bug18872.phpt

@ -0,0 +1,18 @@
--TEST--
Bug #18872 (class constant used as default parameter)
--FILE--
<?php
class FooBar {
const BIFF = 3;
}
function foo($biff = FooBar::BIFF) {
echo $biff . "\n";
}
foo();
foo();
?>
--EXPECT--
3
3

16
tests/lang/bug23279.phpt

@ -0,0 +1,16 @@
--TEST--
Bug #23279 (exception handler stops after first function call)
--FILE--
<?php
ob_start();
set_exception_handler('redirect_on_error');
echo "Hello World\n";
throw new Exception;
function redirect_on_error($e) {
ob_end_clean();
echo "Goodbye Cruel World\n";
}
?>
--EXPECT--
Goodbye Cruel World

30
tests/lang/bug23384.phpt

@ -0,0 +1,30 @@
--TEST--
Bug #23384 (use of class constants in statics)
--FILE--
<?php
define('TEN', 10);
class Foo {
const HUN = 100;
function test($x = Foo::HUN) {
static $arr2 = array(TEN => 'ten');
static $arr = array(Foo::HUN => 'ten');
print_r($arr);
print_r($arr2);
print_r($x);
}
}
Foo::test();
echo Foo::HUN."\n";
?>
--EXPECT--
Array
(
[100] => ten
)
Array
(
[10] => ten
)
100100
Loading…
Cancel
Save