From: Felipe Pena Date: Sun, 18 Jan 2009 13:28:58 +0000 (+0000) Subject: - New tests X-Git-Tag: php-5.2.9RC1~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ed65d36f9e3ca91acea977343a0d1f3f5d7da17;p=php - New tests --- diff --git a/ext/dbase/tests/dbase_get_header_info_001.phpt b/ext/dbase/tests/dbase_get_header_info_001.phpt new file mode 100644 index 0000000000..ccbf6309d2 --- /dev/null +++ b/ext/dbase/tests/dbase_get_header_info_001.phpt @@ -0,0 +1,90 @@ +--TEST-- +dbase_get_header_info() - Basic test +--FILE-- + +--EXPECT-- +array(4) { + [0]=> + array(6) { + ["name"]=> + string(4) "date" + ["type"]=> + string(4) "date" + ["length"]=> + int(8) + ["precision"]=> + int(0) + ["format"]=> + string(3) "%8s" + ["offset"]=> + int(1) + } + [1]=> + array(6) { + ["name"]=> + string(4) "name" + ["type"]=> + string(9) "character" + ["length"]=> + int(50) + ["precision"]=> + int(0) + ["format"]=> + string(5) "%-50s" + ["offset"]=> + int(9) + } + [2]=> + array(6) { + ["name"]=> + string(5) "email" + ["type"]=> + string(9) "character" + ["length"]=> + int(128) + ["precision"]=> + int(0) + ["format"]=> + string(6) "%-128s" + ["offset"]=> + int(59) + } + [3]=> + array(6) { + ["name"]=> + string(8) "ismember" + ["type"]=> + string(7) "boolean" + ["length"]=> + int(1) + ["precision"]=> + int(0) + ["format"]=> + string(3) "%1s" + ["offset"]=> + int(187) + } +} diff --git a/ext/dbase/tests/dbase_get_record_with_names_001.phpt b/ext/dbase/tests/dbase_get_record_with_names_001.phpt new file mode 100644 index 0000000000..f51ddc5aa0 --- /dev/null +++ b/ext/dbase/tests/dbase_get_record_with_names_001.phpt @@ -0,0 +1,71 @@ +--TEST-- +dbase_get_record_with_names() - Basic test +--FILE-- + +--EXPECTF-- +array(5) { + ["date"]=> + string(8) "%d" + ["name"]=> + string(50) "Name #1 " + ["email"]=> + string(128) "Email #1 " + ["ismember"]=> + int(1) + ["deleted"]=> + int(1) +} +array(5) { + ["date"]=> + string(8) "%d" + ["name"]=> + string(50) "Name #2 " + ["email"]=> + string(128) "Email #2 " + ["ismember"]=> + int(1) + ["deleted"]=> + int(0) +} +int(2) +int(4) diff --git a/ext/dbase/tests/dbase_pack_001.phpt b/ext/dbase/tests/dbase_pack_001.phpt new file mode 100644 index 0000000000..02a65efb53 --- /dev/null +++ b/ext/dbase/tests/dbase_pack_001.phpt @@ -0,0 +1,54 @@ +--TEST-- +dbase_pack() - Basic test +--FILE-- + +--EXPECTF-- +array(5) { + [0]=> + string(8) "%d" + [1]=> + string(50) "Name #1 " + [2]=> + string(128) "Email #1 " + [3]=> + int(1) + ["deleted"]=> + int(1) +} + +Warning: dbase_get_record(): Tried to read bad record 1 in %s on line %d +bool(false)