xref: /php-src/ext/dba/tests/dba_inifile.phpt (revision eddab740)
1--TEST--
2DBA INIFILE handler test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7require_once __DIR__ . '/setup/setup_dba_tests.inc';
8check_skip('inifile');
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/setup/setup_dba_tests.inc';
13$db_name = 'dba_inifile.db';
14
15$handler = 'inifile';
16run_standard_tests($handler, $db_name);
17
18?>
19--CLEAN--
20<?php
21require_once __DIR__ . '/setup/setup_dba_tests.inc';
22$db_name = 'dba_inifile.db';
23cleanup_standard_db($db_name);
24?>
25--WHITESPACE_SENSITIVE--
26--EXPECT--
27=== RUNNING WITH FILE LOCK ===
28Remove key 1 and 3
29bool(true)
30bool(true)
31Try to remove key 1 again
32bool(false)
33key2: Content String 2
34key4: Another Content String
35key5: The last content string
36name9: Content String 9
37[key10]:
38[key10]name10: Content String 10
39[key30]:
40[key30]name30: Content String 30
41Total keys: 8
42Key 1 exists? N
43Key 2 exists? Y
44Key 3 exists? N
45Key 4 exists? Y
46Key 5 exists? Y
47Replace second key data
48bool(true)
49Content 2 replaced
50Read during write: not allowed
51Expected: Added a new data entry
52Unexpected: Wrote data to already used key
53Replace second key data
54bool(true)
55Delete "key4"
56bool(true)
57Fetch "key2": Content 2 replaced 2nd time
58Fetch "key number 6": The 6th value
59array(8) {
60  ["[key10]"]=>
61  string(0) ""
62  ["[key10]name10"]=>
63  string(17) "Content String 10"
64  ["[key30]"]=>
65  string(0) ""
66  ["[key30]name30"]=>
67  string(17) "Content String 30"
68  ["key number 6"]=>
69  string(13) "The 6th value"
70  ["key2"]=>
71  string(27) "Content 2 replaced 2nd time"
72  ["key5"]=>
73  string(23) "The last content string"
74  ["name9"]=>
75  string(16) "Content String 9"
76}
77=== RUNNING WITH DB LOCK (default) ===
78SAME OUTPUT AS PREVIOUS RUN
79=== RUNNING WITH NO LOCK ===
80SAME OUTPUT AS PREVIOUS RUN (modulo read during write due to no lock)
81