mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
add new tests
This commit is contained in:
parent
d38a901189
commit
5ece2f6369
26
Zend/tests/error_reporting01.phpt
Normal file
26
Zend/tests/error_reporting01.phpt
Normal file
@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo($arg) {
|
||||
}
|
||||
|
||||
function bar() {
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
try {
|
||||
@foo(@bar());
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2047)
|
||||
Done
|
27
Zend/tests/error_reporting02.phpt
Normal file
27
Zend/tests/error_reporting02.phpt
Normal file
@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 2
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo($arg) {
|
||||
}
|
||||
|
||||
function bar() {
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
try {
|
||||
@foo(@bar());
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4095)
|
||||
Done
|
35
Zend/tests/error_reporting03.phpt
Normal file
35
Zend/tests/error_reporting03.phpt
Normal file
@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 3
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo($arg) {
|
||||
echo @$nonex_foo;
|
||||
}
|
||||
|
||||
function bar() {
|
||||
echo @$nonex_bar;
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
function foo1() {
|
||||
echo $undef1;
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
echo $undef2;
|
||||
}
|
||||
|
||||
try {
|
||||
@foo(@bar(@foo1()));
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef2 in %s on line %d
|
||||
int(4095)
|
||||
Done
|
23
Zend/tests/error_reporting04.phpt
Normal file
23
Zend/tests/error_reporting04.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 4
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo() {
|
||||
echo $undef;
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
}
|
||||
|
||||
|
||||
foo(@$var);
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef in %s on line %d
|
||||
int(4095)
|
||||
Done
|
34
Zend/tests/error_reporting05.phpt
Normal file
34
Zend/tests/error_reporting05.phpt
Normal file
@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 5
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class test {
|
||||
function __get($name) {
|
||||
return $undef_name;
|
||||
}
|
||||
function __set($name, $value) {
|
||||
return $undef_value;
|
||||
}
|
||||
}
|
||||
|
||||
$test = new test;
|
||||
|
||||
$test->abc = 123;
|
||||
echo $test->bcd;
|
||||
|
||||
@$test->qwe = 123;
|
||||
echo @$test->wer;
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef_value in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef_name in %s on line %d
|
||||
int(2047)
|
||||
Done
|
30
Zend/tests/error_reporting06.phpt
Normal file
30
Zend/tests/error_reporting06.phpt
Normal file
@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 6
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo1($arg) {
|
||||
}
|
||||
|
||||
function foo2($arg) {
|
||||
}
|
||||
|
||||
function foo3($arg) {
|
||||
echo $undef3;
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
try {
|
||||
@foo1(@foo2(@foo3()));
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2047)
|
||||
Done
|
30
Zend/tests/error_reporting07.phpt
Normal file
30
Zend/tests/error_reporting07.phpt
Normal file
@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 7
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo1($arg) {
|
||||
}
|
||||
|
||||
function foo2($arg) {
|
||||
}
|
||||
|
||||
function foo3($arg) {
|
||||
echo $undef3;
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
try {
|
||||
@error_reporting(@foo1(@foo2(@foo3())));
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(2047)
|
||||
Done
|
32
Zend/tests/error_reporting08.phpt
Normal file
32
Zend/tests/error_reporting08.phpt
Normal file
@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 8
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function foo1($arg) {
|
||||
}
|
||||
|
||||
function foo2($arg) {
|
||||
}
|
||||
|
||||
function foo3($arg) {
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
echo $undef3;
|
||||
throw new Exception("test");
|
||||
}
|
||||
|
||||
try {
|
||||
@foo1(@foo2(@foo3()));
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: undef3 in %s on line %d
|
||||
int(4095)
|
||||
Done
|
31
Zend/tests/error_reporting09.phpt
Normal file
31
Zend/tests/error_reporting09.phpt
Normal file
@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 9
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function bar() {
|
||||
echo @$blah;
|
||||
echo $undef2;
|
||||
}
|
||||
|
||||
function foo() {
|
||||
echo @$undef;
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
echo $blah;
|
||||
return bar();
|
||||
}
|
||||
|
||||
@foo();
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: blah in %s on line %d
|
||||
|
||||
Notice: Undefined variable: undef2 in %s on line %d
|
||||
int(4095)
|
||||
Done
|
35
Zend/tests/error_reporting10.phpt
Normal file
35
Zend/tests/error_reporting10.phpt
Normal file
@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
testing @ and error_reporting - 10
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
function make_exception()
|
||||
{
|
||||
@$blah;
|
||||
str_replace();
|
||||
error_reporting(0);
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
try {
|
||||
@make_exception();
|
||||
} catch (Exception $e) {}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
error_reporting(E_ALL&~E_NOTICE);
|
||||
|
||||
try {
|
||||
@make_exception();
|
||||
} catch (Exception $e) {}
|
||||
|
||||
var_dump(error_reporting());
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(0)
|
||||
int(0)
|
||||
Done
|
Loading…
Reference in New Issue
Block a user