forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdba_gdbm.phpt
125 lines (118 loc) · 2.84 KB
/
dba_gdbm.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
--TEST--
DBA GDBM handler test
--EXTENSIONS--
dba
--SKIPIF--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
check_skip('gdbm');
?>
--FILE--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'dba_gdbm.db';
$handler = 'gdbm';
run_standard_tests($handler, $db_name);
?>
--CLEAN--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'dba_gdbm.db';
cleanup_standard_db($db_name);
?>
--EXPECTF--
=== RUNNING WITH FILE LOCK ===
Notice: dba_open(): Handler gdbm does locking internally in %s on line %d
Notice: dba_open(): Handler gdbm does locking internally in %s on line %d
Notice: dba_open(): Handler gdbm does locking internally in %s on line %d
Remove key 1 and 3
bool(true)
bool(true)
Try to remove key 1 again
bool(false)
[key10]name10: Content String 10
[key30]name30: Content String 30
key2: Content String 2
key4: Another Content String
key5: The last content string
name9: Content String 9
Total keys: 6
Key 1 exists? N
Key 2 exists? Y
Key 3 exists? N
Key 4 exists? Y
Key 5 exists? Y
Replace second key data
bool(true)
Content 2 replaced
Read during write: not allowed
Expected: Added a new data entry
Expected: Failed to insert data for already used key
Replace second key data
bool(true)
Delete "key4"
bool(true)
Fetch "key2": Content 2 replaced 2nd time
Fetch "key number 6": The 6th value
Notice: dba_open(): Handler gdbm does locking internally in %s on line 1%d
array(6) {
["[key10]name10"]=>
string(17) "Content String 10"
["[key30]name30"]=>
string(17) "Content String 30"
["key number 6"]=>
string(13) "The 6th value"
["key2"]=>
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
["name9"]=>
string(16) "Content String 9"
}
=== RUNNING WITH DB LOCK (default) ===
Remove key 1 and 3
bool(true)
bool(true)
Try to remove key 1 again
bool(false)
[key10]name10: Content String 10
[key30]name30: Content String 30
key2: Content String 2
key4: Another Content String
key5: The last content string
name9: Content String 9
Total keys: 6
Key 1 exists? N
Key 2 exists? Y
Key 3 exists? N
Key 4 exists? Y
Key 5 exists? Y
Replace second key data
bool(true)
Content 2 replaced
Read during write: not allowed
Expected: Added a new data entry
Expected: Failed to insert data for already used key
Replace second key data
bool(true)
Delete "key4"
bool(true)
Fetch "key2": Content 2 replaced 2nd time
Fetch "key number 6": The 6th value
array(6) {
["[key10]name10"]=>
string(17) "Content String 10"
["[key30]name30"]=>
string(17) "Content String 30"
["key number 6"]=>
string(13) "The 6th value"
["key2"]=>
string(27) "Content 2 replaced 2nd time"
["key5"]=>
string(23) "The last content string"
["name9"]=>
string(16) "Content String 9"
}
=== RUNNING WITH NO LOCK ===
Warning: dba_open(): Locking cannot be disabled for handler gdbm in %s on line %d
Failed to create DB