Skip to content

Commit 5e8f9f6

Browse files
committed
update unit testing "update.t"
1 parent 6759992 commit 5e8f9f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

t/02-query/update.t

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,21 @@ $update = $sql_abstract->update(
113113
is($sql_abstract->to_one_liner($update),
114114
$to_compare, "SQL Query No Prepare Statement : \n$update");
115115

116+
117+
# with 3 argument
118+
$update = $sql_abstract->update(
119+
'table_test',
120+
{'clause_col1' => 'val1', 'col2' => 'val2', 'col3' => 'val3'},
121+
{
122+
'where' =>
123+
"clause_col1 = 'clause_val1' AND clause_col2 = 'clause_val2' OR clause_col3 = 'clause_val3'",
124+
}
125+
);
126+
like(
127+
$sql_abstract->to_one_liner($update),
128+
qr/UPDATE(.*)SET(.*)\=(.*)WHERE(.*)/,
129+
"SQL Query : \n$update"
130+
);
131+
132+
116133
done_testing();

0 commit comments

Comments
 (0)