From c21a9f21bbfcaed00db8695f678125d48cf831a5 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Mon, 1 Mar 2010 20:33:18 +0000 Subject: [PATCH] Improve basic code coverage --- ext/dba/tests/clean.inc | 5 +++ ext/dba/tests/dba010.phpt | 41 +++++++++++++++++ ext/dba/tests/dba_optimize.phpt | 45 +++++++++++++++++++ ext/dba/tests/dba_split.phpt | 79 +++++++++++++++++++++++++++++++++ ext/dba/tests/dba_sync.phpt | 45 +++++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 ext/dba/tests/clean.inc create mode 100644 ext/dba/tests/dba010.phpt create mode 100644 ext/dba/tests/dba_optimize.phpt create mode 100644 ext/dba/tests/dba_split.phpt create mode 100644 ext/dba/tests/dba_sync.phpt diff --git a/ext/dba/tests/clean.inc b/ext/dba/tests/clean.inc new file mode 100644 index 0000000000..7c53e7e61f --- /dev/null +++ b/ext/dba/tests/clean.inc @@ -0,0 +1,5 @@ + diff --git a/ext/dba/tests/dba010.phpt b/ext/dba/tests/dba010.phpt new file mode 100644 index 0000000000..183562dc32 --- /dev/null +++ b/ext/dba/tests/dba010.phpt @@ -0,0 +1,41 @@ +--TEST-- +DBA with array keys +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +database handler: flatfile +6YYYYYY \ No newline at end of file diff --git a/ext/dba/tests/dba_optimize.phpt b/ext/dba/tests/dba_optimize.phpt new file mode 100644 index 0000000000..334a705fd7 --- /dev/null +++ b/ext/dba/tests/dba_optimize.phpt @@ -0,0 +1,45 @@ +--TEST-- +DBA Optimize Test +--SKIPIF-- +--FILE-- + +===DONE=== + +--EXPECTF-- +database handler: flatfile +2YY + +Warning: Wrong parameter count for dba_optimize() in %sdba_optimize.php on line %d +NULL + +Warning: dba_optimize(): supplied argument is not a valid DBA identifier resource in %sdba_optimize.php on line %d +bool(false) +bool(true) +===DONE=== diff --git a/ext/dba/tests/dba_split.phpt b/ext/dba/tests/dba_split.phpt new file mode 100644 index 0000000000..9488992588 --- /dev/null +++ b/ext/dba/tests/dba_split.phpt @@ -0,0 +1,79 @@ +--TEST-- +DBA Split Test +--SKIPIF-- +--FILE-- + +===DONE=== + +--EXPECTF-- +Warning: Wrong parameter count for dba_key_split() in %sdba_split.php on line %d +NULL +array(2) { + [0]=> + %unicode|string%(0) "" + [1]=> + %unicode|string%(1) "1" +} +bool(false) +array(2) { + [0]=> + %unicode|string%(0) "" + [1]=> + %unicode|string%(0) "" +} +array(2) { + [0]=> + %unicode|string%(0) "" + [1]=> + %unicode|string%(5) "name1" +} +array(2) { + [0]=> + %unicode|string%(0) "" + [1]=> + %unicode|string%(5) "[key1" +} +array(2) { + [0]=> + %unicode|string%(4) "key1" + [1]=> + %unicode|string%(0) "" +} +array(2) { + [0]=> + %unicode|string%(0) "" + [1]=> + %unicode|string%(5) "key1]" +} +array(2) { + [0]=> + %unicode|string%(4) "key1" + [1]=> + %unicode|string%(5) "name1" +} +array(2) { + [0]=> + %unicode|string%(4) "key1" + [1]=> + %unicode|string%(16) "name1[key2]name2" +} +array(2) { + [0]=> + %unicode|string%(4) "key1" + [1]=> + %unicode|string%(5) "name1" +} +===DONE=== diff --git a/ext/dba/tests/dba_sync.phpt b/ext/dba/tests/dba_sync.phpt new file mode 100644 index 0000000000..7c63d2e75d --- /dev/null +++ b/ext/dba/tests/dba_sync.phpt @@ -0,0 +1,45 @@ +--TEST-- +DBA Sync Test +--SKIPIF-- +--FILE-- + +===DONE=== + +--EXPECTF-- +database handler: flatfile +2YY + +Warning: Wrong parameter count for dba_sync() in %sdba_sync.php on line %d +NULL + +Warning: dba_sync(): supplied argument is not a valid DBA identifier resource in %sdba_sync.php on line %d +bool(false) +bool(true) +===DONE=== -- 2.50.1