summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2000-08-27 19:46:06 +0000
committerStig Bakken <ssb@php.net>2000-08-27 19:46:06 +0000
commit315f4f5658cf22a17ba06fa2ca2f3d890355873f (patch)
tree3dd1134c1d1c3821b48fab806884123f09b2d21f /tests/basic
parent7eeda99a055df5a510d3d20526e9adcb42fecdb0 (diff)
downloadphp-git-315f4f5658cf22a17ba06fa2ca2f3d890355873f.tar.gz
@PHP 3 regression testing framework re-born (Stig)
Took the old PHP 3 regression testing framework and rewrote it in PHP. Should work on both Windows and UNIX, however I have not tested it on Windows. See tests/README for how to write tests. Added the PHP 3 tests and converted most of them.
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/001.phpt8
-rw-r--r--tests/basic/002.phpt10
-rw-r--r--tests/basic/003.phpt12
-rw-r--r--tests/basic/004.phpt11
-rw-r--r--tests/basic/005.phpt11
-rw-r--r--tests/basic/006.phpt8
-rw-r--r--tests/basic/007.phpt8
-rw-r--r--tests/basic/008.phpt8
-rw-r--r--tests/basic/009.phpt8
-rw-r--r--tests/basic/010.phpt8
-rw-r--r--tests/basic/011.phpt17
11 files changed, 109 insertions, 0 deletions
diff --git a/tests/basic/001.phpt b/tests/basic/001.phpt
new file mode 100644
index 0000000000..4cc79613c5
--- /dev/null
+++ b/tests/basic/001.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Trivial "Hello World" test
+--POST--
+--GET--
+--FILE--
+<?php echo "Hello World"?>
+--EXPECT--
+Hello World
diff --git a/tests/basic/002.phpt b/tests/basic/002.phpt
new file mode 100644
index 0000000000..d694a201c2
--- /dev/null
+++ b/tests/basic/002.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Simple POST Method test
+--POST--
+a=Hello+World
+--GET--
+--FILE--
+<?php error_reporting(0);
+echo $a?>
+--EXPECT--
+Hello World
diff --git a/tests/basic/003.phpt b/tests/basic/003.phpt
new file mode 100644
index 0000000000..c728a79efd
--- /dev/null
+++ b/tests/basic/003.phpt
@@ -0,0 +1,12 @@
+--TEST--
+GET and POST Method combined
+--POST--
+a=Hello+World
+--GET--
+b=Hello+Again+World&c=Hi+Mom
+--FILE--
+<?php
+error_reporting(0);
+echo "$a $b $c"?>
+--EXPECT--
+Hello World Hello Again World Hi Mom
diff --git a/tests/basic/004.phpt b/tests/basic/004.phpt
new file mode 100644
index 0000000000..4e8eb2b2c0
--- /dev/null
+++ b/tests/basic/004.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Two variables in POST data
+--POST--
+a=Hello+World&b=Hello+Again+World
+--GET--
+--FILE--
+<?php
+error_reporting(0);
+echo "$a $b"?>
+--EXPECT--
+Hello World Hello Again World
diff --git a/tests/basic/005.phpt b/tests/basic/005.phpt
new file mode 100644
index 0000000000..9a30c59194
--- /dev/null
+++ b/tests/basic/005.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Three variables in POST data
+--POST--
+a=Hello+World&b=Hello+Again+World&c=1
+--GET--
+--FILE--
+<?php
+error_reporting(0);
+echo "$a $b $c"?>
+--EXPECT--
+Hello World Hello Again World 1
diff --git a/tests/basic/006.phpt b/tests/basic/006.phpt
new file mode 100644
index 0000000000..3b88acc32f
--- /dev/null
+++ b/tests/basic/006.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Add 3 variables together and print result
+--POST--
+--GET--
+--FILE--
+<?php $a=1; $b=2; $c=3; $d=$a+$b+$c; echo $d?>
+--EXPECT--
+6
diff --git a/tests/basic/007.phpt b/tests/basic/007.phpt
new file mode 100644
index 0000000000..90fdc7e545
--- /dev/null
+++ b/tests/basic/007.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Multiply 3 variables and print result
+--POST--
+--GET--
+--FILE--
+<?php $a=2; $b=4; $c=8; $d=$a*$b*$c; echo $d?>
+--EXPECT--
+64
diff --git a/tests/basic/008.phpt b/tests/basic/008.phpt
new file mode 100644
index 0000000000..927bf0e509
--- /dev/null
+++ b/tests/basic/008.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Divide 3 variables and print result
+--POST--
+--GET--
+--FILE--
+<?php $a=27; $b=3; $c=3; $d=$a/$b/$c; echo $d?>
+--EXPECT--
+3
diff --git a/tests/basic/009.phpt b/tests/basic/009.phpt
new file mode 100644
index 0000000000..d78b195d0b
--- /dev/null
+++ b/tests/basic/009.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Subtract 3 variables and print result
+--POST--
+--GET--
+--FILE--
+<?php $a=27; $b=7; $c=10; $d=$a-$b-$c; echo $d?>
+--EXPECT--
+10
diff --git a/tests/basic/010.phpt b/tests/basic/010.phpt
new file mode 100644
index 0000000000..4440d99bf8
--- /dev/null
+++ b/tests/basic/010.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Testing | and & operators
+--POST--
+--GET--
+--FILE--
+<?php $a=8; $b=4; $c=8; echo $a|$b&$c?>
+--EXPECT--
+8
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt
new file mode 100644
index 0000000000..7c2d395b9d
--- /dev/null
+++ b/tests/basic/011.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Testing $argc and $argv handling
+--POST--
+--GET--
+ab+cd+ef+123+test
+--FILE--
+<?php
+ for($i=0;$i<$argc;$i++) {
+ echo "$i: ".$argv[$i]."\n";
+ }
+?>
+--EXPECT--
+0: ab
+1: cd
+2: ef
+3: 123
+4: test