summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Schneider2008-04-01 15:22:15 +0000
committerChristian Schneider2008-04-01 15:22:15 +0000
commit479528efc0dafcf0dd57a48dc8d9dd1a270827b8 (patch)
tree5b6e2fec9d6313366abb91b0bada3f4e06918a46 /tests
parentc226e4acff8b0f06520ee61803bc9b8972a15cbd (diff)
downloaditools-479528efc0dafcf0dd57a48dc8d9dd1a270827b8.tar.gz
itools-479528efc0dafcf0dd57a48dc8d9dd1a270827b8.tar.bz2
itools-479528efc0dafcf0dd57a48dc8d9dd1a270827b8.zip
Allow multiple arguments as query to select() and constructor
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_dbi.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t
index 82826f1..afffbae 100755
--- a/tests/it_dbi.t
+++ b/tests/it_dbi.t
@@ -6,7 +6,7 @@
require 'searchlib/search_test.class';
# Initialize DB
-$db = array('db' => "lib_search_ch");
+$db = array('db' => "lib_search_ch", 'safety' => 0);
$dbi = new it_dbi($db);
$dbi->query('create temporary table it_dbi_test (
ID int not null auto_increment,
@@ -34,6 +34,31 @@ is(
"read"
);
+is(
+ $record->select(),
+ 3,
+ "select without parameters select all",
+);
+
+is(
+ $record->select(array('foo <>' => ""), "LIMIT 1"),
+ 1,
+ "select with multiple parameters (LIMIT part)"
+);
+is(
+ $record->foo,
+ "bar",
+ "select with multiple parameters (foo part)"
+);
+
+$record = new it_dbi($db + array('table' => "it_dbi_test"), array('x >' => 0), "ORDER BY x DESC");
+is(
+ $record->x,
+ 64738,
+ "constructor with multiple select parameters"
+);
+
+
$record->select(array('x' => 64738));
is(
array($record->_key, $record->x, $record->foo),