Skip to content

Commit b4035be

Browse files
committed
tests: added API_GetRecordInfo
1 parent d6b39ba commit b4035be

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

tests/API_AddRecord.php

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,62 @@
3131
throw new Exception('Mismatched API_AddRecord Data Structure');
3232
}
3333

34+
$rid = $actual['rid'];
35+
36+
$expected = array(
37+
'action' => 'API_GetRecordInfo',
38+
'errcode' => 0,
39+
'errtext' => 'No error',
40+
'rid' => 0,
41+
'num_fields' => 0,
42+
'update_id' => 0,
43+
'field' => array(
44+
array(
45+
'fid' => 0,
46+
'name' => '',
47+
'type' => '',
48+
'value' => 0,
49+
'printable' => ''
50+
),
51+
array(
52+
'fid' => 0,
53+
'name' => '',
54+
'type' => '',
55+
'value' => 0,
56+
'printable' => ''
57+
),
58+
array(
59+
'fid' => 0,
60+
'name' => '',
61+
'type' => '',
62+
'value' => 0
63+
),
64+
array(
65+
'fid' => 0,
66+
'name' => '',
67+
'type' => '',
68+
'value' => '',
69+
'printable' => ''
70+
),
71+
array(
72+
'fid' => 0,
73+
'name' => '',
74+
'type' => '',
75+
'value' => '',
76+
'printable' => ''
77+
)
78+
)
79+
);
80+
81+
$actual = $qb->api('API_GetRecordInfo', array(
82+
'dbid' => getenv('dbid'),
83+
'rid' => $rid
84+
));
85+
86+
if(!objStrctMatch($actual, $expected)){
87+
throw new Exception('Mismatched API_GetRecordInfo Data Structure');
88+
}
89+
3490
$expected = array(
3591
'action' => 'API_DeleteRecord',
3692
'errcode' => 0,
@@ -40,7 +96,7 @@
4096

4197
$actual = $qb->api('API_DeleteRecord', array(
4298
'dbid' => getenv('dbid'),
43-
'rid' => $actual['rid']
99+
'rid' => $rid
44100
));
45101

46102
if(!objStrctMatch($actual, $expected)){

0 commit comments

Comments
 (0)