summaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:39:08 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:39:08 -0400
commit993e1866df547532a05ab6db76c9ff5aefc9a3df (patch)
tree169d3bde0974235d3cde164786ef6f381a4749a7 /tests/lang
parent1f589a2bd44ba835ad1b009a5d83abd453724829 (diff)
downloadphp-upstream/5.2.6.tar.gz
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/bug22592.phpt6
-rwxr-xr-xtests/lang/bug27439.phpt2
-rw-r--r--tests/lang/empty_variation.phpt14
-rw-r--r--tests/lang/inc_throw.inc5
-rw-r--r--tests/lang/include_files/echo.inc3
-rw-r--r--tests/lang/include_files/eval.inc3
-rw-r--r--tests/lang/include_files/function.inc3
-rw-r--r--tests/lang/include_variation1.phpt8
-rw-r--r--tests/lang/include_variation2.phpt9
-rw-r--r--tests/lang/include_variation3.phpt8
-rw-r--r--tests/lang/throw_variation_001.phpt14
11 files changed, 71 insertions, 4 deletions
diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt
index 351ea08b9..270584185 100644
--- a/tests/lang/bug22592.phpt
+++ b/tests/lang/bug22592.phpt
@@ -46,8 +46,8 @@ string(8) "4-4s4s*0"
string(9) "4-4s4s505"
string(9) "454s4s505"
string(1) "-"
-string(6) "string"
-int(4)
-int(5)
+string(1) "s"
+string(1) "4"
+string(1) "5"
string(1) "5"
[Illegal string offset: -1]
diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt
index b12fd1ec6..5b7d875d3 100755
--- a/tests/lang/bug27439.phpt
+++ b/tests/lang/bug27439.phpt
@@ -65,7 +65,7 @@ echo "===DONE===";
?>
--EXPECTF--
123
-Notice: Undefined property: test::$foobar in %s on line %d
+Notice: Undefined property: test::$foobar in %s on line %d
Warning: Invalid argument supplied for foreach() in %s on line %d
diff --git a/tests/lang/empty_variation.phpt b/tests/lang/empty_variation.phpt
new file mode 100644
index 000000000..8e940dae5
--- /dev/null
+++ b/tests/lang/empty_variation.phpt
@@ -0,0 +1,14 @@
+--TEST--
+empty() on array elements
+--FILE--
+<?php
+$a=array('0','empty'=>'0');
+var_dump(empty($a['empty']));
+var_dump(empty($a[0]));
+$b='0';
+var_dump(empty($b));
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
diff --git a/tests/lang/inc_throw.inc b/tests/lang/inc_throw.inc
new file mode 100644
index 000000000..1f032f7e7
--- /dev/null
+++ b/tests/lang/inc_throw.inc
@@ -0,0 +1,5 @@
+<?php
+
+throw new Exception();
+
+?>
diff --git a/tests/lang/include_files/echo.inc b/tests/lang/include_files/echo.inc
new file mode 100644
index 000000000..60714f6e4
--- /dev/null
+++ b/tests/lang/include_files/echo.inc
@@ -0,0 +1,3 @@
+<?php
+echo "Included!\n";
+?> \ No newline at end of file
diff --git a/tests/lang/include_files/eval.inc b/tests/lang/include_files/eval.inc
new file mode 100644
index 000000000..16da86295
--- /dev/null
+++ b/tests/lang/include_files/eval.inc
@@ -0,0 +1,3 @@
+<?php
+eval("require_once 'echo.inc';");
+?> \ No newline at end of file
diff --git a/tests/lang/include_files/function.inc b/tests/lang/include_files/function.inc
new file mode 100644
index 000000000..528f46c56
--- /dev/null
+++ b/tests/lang/include_files/function.inc
@@ -0,0 +1,3 @@
+<?php
+function test() { require_once 'echo.inc'; }
+?>
diff --git a/tests/lang/include_variation1.phpt b/tests/lang/include_variation1.phpt
new file mode 100644
index 000000000..cf99ba9d3
--- /dev/null
+++ b/tests/lang/include_variation1.phpt
@@ -0,0 +1,8 @@
+--TEST--
+include() a file from the current script directory
+--FILE--
+<?php
+include("inc.inc");
+?>
+--EXPECT--
+Included!
diff --git a/tests/lang/include_variation2.phpt b/tests/lang/include_variation2.phpt
new file mode 100644
index 000000000..051ed7157
--- /dev/null
+++ b/tests/lang/include_variation2.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Including a file in the current script directory from an included function
+--FILE--
+<?php
+require_once 'include_files/function.inc';
+test();
+?>
+--EXPECT--
+Included!
diff --git a/tests/lang/include_variation3.phpt b/tests/lang/include_variation3.phpt
new file mode 100644
index 000000000..1fa80c5ab
--- /dev/null
+++ b/tests/lang/include_variation3.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Including a file in the current script directory from eval'd code
+--FILE--
+<?php
+require_once 'include_files/eval.inc';
+?>
+--EXPECT--
+Included! \ No newline at end of file
diff --git a/tests/lang/throw_variation_001.phpt b/tests/lang/throw_variation_001.phpt
new file mode 100644
index 000000000..d942a8793
--- /dev/null
+++ b/tests/lang/throw_variation_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Catching an exception thrown from an included file
+--FILE--
+<?php
+
+try {
+ include "inc_throw.inc";
+} catch (Exception $e) {
+ echo "caught exception\n";
+}
+
+?>
+--EXPECT--
+caught exception