From: Georg Richter Date: Wed, 12 Feb 2003 00:46:29 +0000 (+0000) Subject: adding a few tests X-Git-Tag: RELEASE_0_5~1091 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff8f0eb7dacb8235090e5b759af5db4bd6ee690e;p=php adding a few tests --- diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt new file mode 100644 index 0000000000..9386f500ed --- /dev/null +++ b/ext/mysqli/tests/001.phpt @@ -0,0 +1,53 @@ +--TEST-- +mysqli connect +--FILE-- + +--EXPECT-- +string(7) "1111111" diff --git a/ext/mysqli/tests/002.phpt b/ext/mysqli/tests/002.phpt new file mode 100644 index 0000000000..bbf5808641 --- /dev/null +++ b/ext/mysqli/tests/002.phpt @@ -0,0 +1,60 @@ +--TEST-- +mysqli bind_result 1 +--FILE-- + +--EXPECT-- +array(11) { + [0]=> + int(1) + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL + [5]=> + NULL + [6]=> + NULL + [7]=> + NULL + [8]=> + NULL + [9]=> + string(4) "foo1" + [10]=> + string(4) "1000" +} diff --git a/ext/mysqli/tests/003.phpt b/ext/mysqli/tests/003.phpt new file mode 100644 index 0000000000..6baae8a481 --- /dev/null +++ b/ext/mysqli/tests/003.phpt @@ -0,0 +1,56 @@ +--TEST-- +mysqli connect +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + string(10) "2002-01-02" + [1]=> + string(8) "12:49:00" + [2]=> + string(19) "2002-01-02 17:46:59" + [3]=> + int(2010) + [4]=> + string(19) "2010-07-10 00:00:00" + [5]=> + string(0) "" + [6]=> + string(19) "1999-12-29 00:00:00" +} diff --git a/ext/mysqli/tests/004.phpt b/ext/mysqli/tests/004.phpt new file mode 100644 index 0000000000..1469bb566f --- /dev/null +++ b/ext/mysqli/tests/004.phpt @@ -0,0 +1,35 @@ +--TEST-- +mysqli fetch char/text +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(10) "1234567890" + [1]=> + string(14) "this is a test" +} diff --git a/ext/mysqli/tests/005.phpt b/ext/mysqli/tests/005.phpt new file mode 100644 index 0000000000..5688770fe0 --- /dev/null +++ b/ext/mysqli/tests/005.phpt @@ -0,0 +1,38 @@ +--TEST-- +mysqli fetch char/text long +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(10) "1234567890" + [1]=> + string(13) "32K String ok" +} diff --git a/ext/mysqli/tests/006.phpt b/ext/mysqli/tests/006.phpt new file mode 100644 index 0000000000..059ce147a7 --- /dev/null +++ b/ext/mysqli/tests/006.phpt @@ -0,0 +1,51 @@ +--TEST-- +mysqli fetch long values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(0) + [1]=> + int(35999) + [2]=> + NULL + [3]=> + int(-500) + [4]=> + int(-9999999) + [5]=> + int(0) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/007.phpt b/ext/mysqli/tests/007.phpt new file mode 100644 index 0000000000..89d1959752 --- /dev/null +++ b/ext/mysqli/tests/007.phpt @@ -0,0 +1,51 @@ +--TEST-- +mysqli fetch short values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(0) + [1]=> + int(35999) + [2]=> + NULL + [3]=> + int(-500) + [4]=> + int(-32768) + [5]=> + int(30) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/008.phpt b/ext/mysqli/tests/008.phpt new file mode 100644 index 0000000000..92498da44c --- /dev/null +++ b/ext/mysqli/tests/008.phpt @@ -0,0 +1,53 @@ +--TEST-- +mysqli fetch tinyint values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(-23) + [1]=> + int(255) + [2]=> + int(0) + [3]=> + int(-100) + [4]=> + int(-127) + [5]=> + int(30) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/009.phpt b/ext/mysqli/tests/009.phpt new file mode 100644 index 0000000000..942b443ebb --- /dev/null +++ b/ext/mysqli/tests/009.phpt @@ -0,0 +1,51 @@ +--TEST-- +mysqli fetch bigint values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(5) + [1]=> + int(-23) + [2]=> + int(4) + [3]=> + string(14) "33333333333333" + [4]=> + int(0) + [5]=> + string(13) "-333333333333" + [6]=> + int(100) +} diff --git a/ext/mysqli/tests/010.phpt b/ext/mysqli/tests/010.phpt new file mode 100644 index 0000000000..2986277fb4 --- /dev/null +++ b/ext/mysqli/tests/010.phpt @@ -0,0 +1,54 @@ +--TEST-- +mysqli fetch float values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + float(3.1415927410126) + [1]=> + float(-9.9999999747524E-7) + [2]=> + float(0) + [3]=> + float(999999995904) + [4]=> + float(0.56464248895645) + [5]=> + float(1) + [6]=> + float(888888914608130) +} diff --git a/ext/mysqli/tests/011.phpt b/ext/mysqli/tests/011.phpt new file mode 100644 index 0000000000..5735e2f1dd --- /dev/null +++ b/ext/mysqli/tests/011.phpt @@ -0,0 +1,53 @@ +--TEST-- +mysqli fetch mixed values +--FILE-- + +--EXPECT-- +array(8) { + [0]=> + int(19) + [1]=> + int(2999) + [2]=> + int(3999) + [3]=> + int(4999999) + [4]=> + float(2345.6000976563) + [5]=> + float(5678.89563) + [6]=> + string(6) "foobar" + [7]=> + string(11) "mysql rulez" +} diff --git a/ext/mysqli/tests/012.phpt b/ext/mysqli/tests/012.phpt new file mode 100644 index 0000000000..38ef311d59 --- /dev/null +++ b/ext/mysqli/tests/012.phpt @@ -0,0 +1,54 @@ +--TEST-- +mysqli fetch mixed values 2 +--FILE-- + +--EXPECT-- +array(8) { + [0]=> + int(120) + [1]=> + int(2999) + [2]=> + int(3999) + [3]=> + int(54) + [4]=> + float(2.5999999046326) + [5]=> + float(58.89) + [6]=> + string(3) "206" + [7]=> + string(3) "6.7" +} diff --git a/ext/mysqli/tests/013.phpt b/ext/mysqli/tests/013.phpt new file mode 100644 index 0000000000..dafc9bba9b --- /dev/null +++ b/ext/mysqli/tests/013.phpt @@ -0,0 +1,45 @@ +--TEST-- +mysqli fetch mixed / mysql_query +--FILE-- + +--EXPECT-- +string(8) "11111111" diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt new file mode 100644 index 0000000000..74ba7b5de8 --- /dev/null +++ b/ext/mysqli/tests/014.phpt @@ -0,0 +1,56 @@ +--TEST-- +mysqli autocommit/commit/rollback +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(1) "1" + [1]=> + string(6) "foobar" +} +array(2) { + [0]=> + string(1) "2" + [1]=> + string(4) "egon" +} diff --git a/ext/mysqli/tests/015.phpt b/ext/mysqli/tests/015.phpt new file mode 100644 index 0000000000..822bf67ab2 --- /dev/null +++ b/ext/mysqli/tests/015.phpt @@ -0,0 +1,55 @@ +--TEST-- +mysqli autocommit/commit/rollback with myisam +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(1) "2" + [1]=> + string(4) "egon" +} +array(2) { + [0]=> + string(1) "2" + [1]=> + string(4) "egon" +} diff --git a/ext/mysqli/tests/016.phpt b/ext/mysqli/tests/016.phpt new file mode 100644 index 0000000000..7d84c29655 --- /dev/null +++ b/ext/mysqli/tests/016.phpt @@ -0,0 +1,25 @@ +--TEST-- +mysqli fetch user variable +--FILE-- + +--EXPECT-- +string(6) "foobar" diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt new file mode 100644 index 0000000000..e7aaf746cf --- /dev/null +++ b/ext/mysqli/tests/017.phpt @@ -0,0 +1,30 @@ +--TEST-- +mysqli fetch functions +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(14) "root@localhost" + [1]=> + string(4) "test" +} diff --git a/ext/mysqli/tests/018.phpt b/ext/mysqli/tests/018.phpt new file mode 100644 index 0000000000..8fb0d44dc5 --- /dev/null +++ b/ext/mysqli/tests/018.phpt @@ -0,0 +1,25 @@ +--TEST-- +mysqli fetch system variables +--FILE-- + +--EXPECT-- +int(0) diff --git a/ext/mysqli/tests/019.phpt b/ext/mysqli/tests/019.phpt new file mode 100644 index 0000000000..0e13f7520a --- /dev/null +++ b/ext/mysqli/tests/019.phpt @@ -0,0 +1,68 @@ +--TEST-- +mysqli fetch (bind_param + bind_result) +--FILE-- + +--EXPECT-- +array(11) { + [0]=> + int(1) + [1]=> + NULL + [2]=> + NULL + [3]=> + NULL + [4]=> + NULL + [5]=> + NULL + [6]=> + NULL + [7]=> + NULL + [8]=> + NULL + [9]=> + string(3) "foo" + [10]=> + string(6) "foobar" +} diff --git a/ext/mysqli/tests/020.phpt b/ext/mysqli/tests/020.phpt new file mode 100644 index 0000000000..53827d0be3 --- /dev/null +++ b/ext/mysqli/tests/020.phpt @@ -0,0 +1,70 @@ +--TEST-- +mysqli bind_param/bind_result date +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + string(10) "2002-01-02" + [1]=> + string(8) "12:49:00" + [2]=> + string(19) "2002-01-02 17:46:59" + [3]=> + int(2010) + [4]=> + string(19) "2010-07-10 00:00:00" + [5]=> + string(0) "" + [6]=> + string(19) "1999-12-29 00:00:00" +} diff --git a/ext/mysqli/tests/021.phpt b/ext/mysqli/tests/021.phpt new file mode 100644 index 0000000000..deabef6933 --- /dev/null +++ b/ext/mysqli/tests/021.phpt @@ -0,0 +1,40 @@ +--TEST-- +mysqli bind_param+bind_result char/text +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(10) "1234567890" + [1]=> + string(14) "this is a test" +} diff --git a/ext/mysqli/tests/022.phpt b/ext/mysqli/tests/022.phpt new file mode 100644 index 0000000000..efd2fef8bd --- /dev/null +++ b/ext/mysqli/tests/022.phpt @@ -0,0 +1,44 @@ +--TEST-- +mysqli bind_param/bind_result char/text long +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(10) "1234567890" + [1]=> + string(13) "32K String ok" +} diff --git a/ext/mysqli/tests/023.phpt b/ext/mysqli/tests/023.phpt new file mode 100644 index 0000000000..fcbd4b2cfc --- /dev/null +++ b/ext/mysqli/tests/023.phpt @@ -0,0 +1,64 @@ +--TEST-- +mysqli bind_param/bind_prepare fetch long values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(0) + [1]=> + int(35999) + [2]=> + NULL + [3]=> + int(-500) + [4]=> + int(-9999999) + [5]=> + int(0) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/024.phpt b/ext/mysqli/tests/024.phpt new file mode 100644 index 0000000000..e31064a02a --- /dev/null +++ b/ext/mysqli/tests/024.phpt @@ -0,0 +1,65 @@ +--TEST-- +mysqli bind_param/bind_result short values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(0) + [1]=> + int(35999) + [2]=> + NULL + [3]=> + int(-500) + [4]=> + int(-32768) + [5]=> + int(0) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/025.phpt b/ext/mysqli/tests/025.phpt new file mode 100644 index 0000000000..f32ef143f2 --- /dev/null +++ b/ext/mysqli/tests/025.phpt @@ -0,0 +1,68 @@ +--TEST-- +mysqli bind_param/bind_result tinyint values +--FILE-- + +--EXPECT-- +array(7) { + [0]=> + int(-23) + [1]=> + int(255) + [2]=> + int(0) + [3]=> + int(-100) + [4]=> + int(-127) + [5]=> + int(30) + [6]=> + int(0) +} diff --git a/ext/mysqli/tests/026.phpt b/ext/mysqli/tests/026.phpt new file mode 100644 index 0000000000..ef1b66862d --- /dev/null +++ b/ext/mysqli/tests/026.phpt @@ -0,0 +1,48 @@ +--TEST-- +mysqli bind_param/bind_result with send_long_data +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(10) "Hello Worl" + [1]=> + string(99) "This is the first sentence. And this is the second sentence. And finally this is the last sentence." +} diff --git a/ext/mysqli/tests/027.phpt b/ext/mysqli/tests/027.phpt new file mode 100644 index 0000000000..ae3657487d --- /dev/null +++ b/ext/mysqli/tests/027.phpt @@ -0,0 +1,21 @@ +--TEST-- +function test: mysqli_stat +--FILE-- + +--EXPECT-- +int(10) diff --git a/ext/mysqli/tests/028.phpt b/ext/mysqli/tests/028.phpt new file mode 100644 index 0000000000..2954d28f3c --- /dev/null +++ b/ext/mysqli/tests/028.phpt @@ -0,0 +1,19 @@ +--TEST-- +function test: mysqli_character_set_name +--FILE-- + +--EXPECT-- +string(6) "latin1" diff --git a/ext/mysqli/tests/029.phpt b/ext/mysqli/tests/029.phpt new file mode 100644 index 0000000000..7680b228e9 --- /dev/null +++ b/ext/mysqli/tests/029.phpt @@ -0,0 +1,25 @@ +--TEST-- +function test: mysqli_affected_rows +--FILE-- + +--EXPECT-- +int(3) diff --git a/ext/mysqli/tests/030.phpt b/ext/mysqli/tests/030.phpt new file mode 100644 index 0000000000..da87218627 --- /dev/null +++ b/ext/mysqli/tests/030.phpt @@ -0,0 +1,24 @@ +--TEST-- +function test: mysqli_errno +--FILE-- + +--EXPECT-- +int(0) +int(1146) diff --git a/ext/mysqli/tests/031.phpt b/ext/mysqli/tests/031.phpt new file mode 100644 index 0000000000..61bfb5bb32 --- /dev/null +++ b/ext/mysqli/tests/031.phpt @@ -0,0 +1,24 @@ +--TEST-- +function test: mysqli_error +--FILE-- + +--EXPECT-- +string(0) "" +string(46) "Table 'test.non_exisiting_table' doesn't exist" diff --git a/ext/mysqli/tests/032.phpt b/ext/mysqli/tests/032.phpt new file mode 100644 index 0000000000..02564834d8 --- /dev/null +++ b/ext/mysqli/tests/032.phpt @@ -0,0 +1,25 @@ +--TEST-- +function test: mysqli_info +--FILE-- + +--EXPECT-- +string(38) "Records: 3 Duplicates: 0 Warnings: 0" diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt new file mode 100644 index 0000000000..e3d8d159d0 --- /dev/null +++ b/ext/mysqli/tests/033.phpt @@ -0,0 +1,19 @@ +--TEST-- +function test: mysqli_get_host_info +--FILE-- + +--EXPECT-- +string(25) "Localhost via UNIX socket" diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt new file mode 100644 index 0000000000..e347586a36 --- /dev/null +++ b/ext/mysqli/tests/034.phpt @@ -0,0 +1,19 @@ +--TEST-- +function test: mysqli_get_proto_info +--FILE-- + +--EXPECT-- +int(10) diff --git a/ext/mysqli/tests/035.phpt b/ext/mysqli/tests/035.phpt new file mode 100644 index 0000000000..34af7c0a56 --- /dev/null +++ b/ext/mysqli/tests/035.phpt @@ -0,0 +1,19 @@ +--TEST-- +function test: mysqli_get_server_info +--FILE-- + +--EXPECT-- +string(1) "4"