summaryrefslogtreecommitdiff
path: root/ext/dba/tests/dba_split.phpt
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2010-10-21 08:52:46 +0200
committerOndřej Surý <ondrej@sury.org>2010-10-21 08:52:46 +0200
commit01fcdff3849c3691d9aaeaab735846ab6d8895ca (patch)
tree6460876d356113fa7053df36f2aa00baa7db24a9 /ext/dba/tests/dba_split.phpt
parent855a09f4eded707941180c9d90acd17c25e29447 (diff)
downloadphp-01fcdff3849c3691d9aaeaab735846ab6d8895ca.tar.gz
Imported Upstream version 5.3.3upstream/5.3.3
Diffstat (limited to 'ext/dba/tests/dba_split.phpt')
-rw-r--r--ext/dba/tests/dba_split.phpt83
1 files changed, 83 insertions, 0 deletions
diff --git a/ext/dba/tests/dba_split.phpt b/ext/dba/tests/dba_split.phpt
new file mode 100644
index 000000000..0989f09fe
--- /dev/null
+++ b/ext/dba/tests/dba_split.phpt
@@ -0,0 +1,83 @@
+--TEST--
+DBA Split Test
+--SKIPIF--
+<?php
+ require_once dirname(__FILE__) .'/skipif.inc';
+ die("info $HND handler used");
+?>
+--FILE--
+<?php
+var_dump(dba_key_split("key1", "name"));
+var_dump(dba_key_split(1));
+var_dump(dba_key_split(null));
+var_dump(dba_key_split(""));
+var_dump(dba_key_split("name1"));
+var_dump(dba_key_split("[key1"));
+var_dump(dba_key_split("[key1]"));
+var_dump(dba_key_split("key1]"));
+var_dump(dba_key_split("[key1]name1"));
+var_dump(dba_key_split("[key1]name1[key2]name2"));
+var_dump(dba_key_split("[key1]name1"));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Warning: Wrong parameter count for dba_key_split() in %sdba_split.php on line %d
+NULL
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(1) "1"
+}
+bool(false)
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+}
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(5) "name1"
+}
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(5) "[key1"
+}
+array(2) {
+ [0]=>
+ string(4) "key1"
+ [1]=>
+ string(0) ""
+}
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(5) "key1]"
+}
+array(2) {
+ [0]=>
+ string(4) "key1"
+ [1]=>
+ string(5) "name1"
+}
+array(2) {
+ [0]=>
+ string(4) "key1"
+ [1]=>
+ string(16) "name1[key2]name2"
+}
+array(2) {
+ [0]=>
+ string(4) "key1"
+ [1]=>
+ string(5) "name1"
+}
+===DONE===