summaryrefslogtreecommitdiff
path: root/tests/run-test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-test')
-rw-r--r--tests/run-test/test001.phpt6
-rw-r--r--tests/run-test/test002.phpt18
-rw-r--r--tests/run-test/test003.phpt6
-rw-r--r--tests/run-test/test004.phpt10
-rw-r--r--tests/run-test/test005.phpt32
-rw-r--r--tests/run-test/test006.phpt9
-rw-r--r--tests/run-test/test007.phptbin0 -> 1191 bytes
-rw-r--r--tests/run-test/test008.phpt33
-rw-r--r--tests/run-test/test008a.phpt32
-rw-r--r--tests/run-test/test009.phpt12
-rw-r--r--tests/run-test/test010.phpt17
11 files changed, 175 insertions, 0 deletions
diff --git a/tests/run-test/test001.phpt b/tests/run-test/test001.phpt
new file mode 100644
index 0000000..370d09c
--- /dev/null
+++ b/tests/run-test/test001.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECT
+--FILE--
+abc
+--EXPECT--
+abc \ No newline at end of file
diff --git a/tests/run-test/test002.phpt b/tests/run-test/test002.phpt
new file mode 100644
index 0000000..7b91f35
--- /dev/null
+++ b/tests/run-test/test002.phpt
@@ -0,0 +1,18 @@
+--TEST--
+EXPECTF
+--FILE--
+123
+-123
++123
++1.1
+abc
+0abc
+x
+--EXPECTF--
+%d
+%i
+%i
+%f
+%s
+%x
+%c \ No newline at end of file
diff --git a/tests/run-test/test003.phpt b/tests/run-test/test003.phpt
new file mode 100644
index 0000000..c1afad1
--- /dev/null
+++ b/tests/run-test/test003.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECTREGEX
+--FILE--
+abcde12314235xyz34264768286abcde
+--EXPECTREGEX--
+[abcde]+[0-5]*xyz[2-8]+abcde \ No newline at end of file
diff --git a/tests/run-test/test004.phpt b/tests/run-test/test004.phpt
new file mode 100644
index 0000000..19dbded
--- /dev/null
+++ b/tests/run-test/test004.phpt
@@ -0,0 +1,10 @@
+--TEST--
+INI section allows '='
+--INI--
+arg_separator.input==
+--FILE--
+<?php
+var_dump(ini_get('arg_separator.input'));
+?>
+--EXPECT--
+string(1) "=" \ No newline at end of file
diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt
new file mode 100644
index 0000000..3d51531
--- /dev/null
+++ b/tests/run-test/test005.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Error message handling (without ZendOptimizer)
+--SKIPIF--
+<?php
+!extension_loaded("Zend Optimizer") or die("skip Zend Optimizer is loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+string(1) "1"
+string(5) "32767"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+NULL
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test006.phpt b/tests/run-test/test006.phpt
new file mode 100644
index 0000000..4dca66a
--- /dev/null
+++ b/tests/run-test/test006.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Error messages are shown
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+$error = 1 / 0;
+?>
+--EXPECTREGEX--
+.*Division by zero.*
diff --git a/tests/run-test/test007.phpt b/tests/run-test/test007.phpt
new file mode 100644
index 0000000..f5f934f
--- /dev/null
+++ b/tests/run-test/test007.phpt
Binary files differ
diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt
new file mode 100644
index 0000000..41733d9
--- /dev/null
+++ b/tests/run-test/test008.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Error message handling (with ZendOptimizer)
+--SKIPIF--
+<?php
+extension_loaded("Zend Optimizer") or die("skip Zend Optimizer is not loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+%s: %sivision by zero in %s on line %d
+string(1) "1"
+string(4) "8191"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+string(%d) "%sivision by zer%s"
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt
new file mode 100644
index 0000000..27da085
--- /dev/null
+++ b/tests/run-test/test008a.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Error message handling (without ZendOptimizer)
+--SKIPIF--
+<?php
+if (extension_loaded("Zend Optimizer")) die("skip Zend Optimizer is loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+string(1) "1"
+string(5) "32767"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+NULL
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test009.phpt b/tests/run-test/test009.phpt
new file mode 100644
index 0000000..650686f
--- /dev/null
+++ b/tests/run-test/test009.phpt
@@ -0,0 +1,12 @@
+--TEST--
+print_r(Object)
+--FILE--
+<?php
+class Foo {}
+$foo = new Foo;
+print_r($foo);
+?>
+--EXPECTF--
+Foo Object
+(
+)
diff --git a/tests/run-test/test010.phpt b/tests/run-test/test010.phpt
new file mode 100644
index 0000000..cc3ca35
--- /dev/null
+++ b/tests/run-test/test010.phpt
@@ -0,0 +1,17 @@
+--TEST--
+STDIN input
+--FILE--
+<?php
+var_dump(stream_get_contents(STDIN));
+var_dump(stream_get_contents(fopen('php://stdin', 'r')));
+var_dump(file_get_contents('php://stdin'));
+?>
+--STDIN--
+fooBar
+use this to input some thing to the php script
+--EXPECT--
+string(54) "fooBar
+use this to input some thing to the php script
+"
+string(0) ""
+string(0) ""