Skip to content

Commit 825fb00

Browse files
committed
Add more null tests
1 parent 277a6e3 commit 825fb00

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

tests/nulls_002.phpt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--TEST--
2+
Test NULLs
3+
--SKIPIF--
4+
<?php include("skipif.inc"); ?>
5+
--FILE--
6+
<?php
7+
8+
require("interbase.inc");
9+
ibase_connect($test_base);
10+
11+
(function(){
12+
ibase_query(
13+
"CREATE TABLE ITEMS (
14+
ID INTEGER,
15+
CODE VARCHAR(5) CHARACTER SET NONE,
16+
MAN_ID INTEGER
17+
)"
18+
);
19+
ibase_commit_ret();
20+
21+
$data = [
22+
[1, "1", 10],
23+
[2, "2", 20],
24+
[3, "", NULL],
25+
[4, "4", 40],
26+
[5, "", NULL],
27+
];
28+
29+
$p = ibase_prepare("INSERT INTO ITEMS (ID, CODE, MAN_ID) VALUES (?, ?, ?)");
30+
31+
foreach ($data as $row) {
32+
ibase_execute($p, ...$row);
33+
}
34+
35+
dump_table_rows("ITEMS");
36+
})();
37+
38+
?>
39+
--EXPECT--
40+
array(3) {
41+
["ID"]=>
42+
int(1)
43+
["CODE"]=>
44+
string(1) "1"
45+
["MAN_ID"]=>
46+
int(10)
47+
}
48+
array(3) {
49+
["ID"]=>
50+
int(2)
51+
["CODE"]=>
52+
string(1) "2"
53+
["MAN_ID"]=>
54+
int(20)
55+
}
56+
array(3) {
57+
["ID"]=>
58+
int(3)
59+
["CODE"]=>
60+
string(0) ""
61+
["MAN_ID"]=>
62+
NULL
63+
}
64+
array(3) {
65+
["ID"]=>
66+
int(4)
67+
["CODE"]=>
68+
string(1) "4"
69+
["MAN_ID"]=>
70+
int(40)
71+
}
72+
array(3) {
73+
["ID"]=>
74+
int(5)
75+
["CODE"]=>
76+
string(0) ""
77+
["MAN_ID"]=>
78+
NULL
79+
}

0 commit comments

Comments
 (0)