add new tests

This commit is contained in:
Antony Dovgal 2005-09-23 09:39:00 +00:00
parent d38a901189
commit 5ece2f6369
10 changed files with 303 additions and 0 deletions

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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