xref: /php-src/ext/dba/tests/dba_tcadb.phpt (revision 41403946)
1--TEST--
2DBA TCADB handler test
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7require_once __DIR__ . '/setup/setup_dba_tests.inc';
8check_skip('tcadb');
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/setup/setup_dba_tests.inc';
13$db_name = 'dba_tcadb.tch';
14
15$handler = 'tcadb';
16set_up_db($handler, $db_name);
17run_standard_tests($handler, $db_name);
18
19?>
20--CLEAN--
21<?php
22require_once __DIR__ . '/setup/setup_dba_tests.inc';
23$db_name = 'dba_tcadb.tch';
24cleanup_standard_db($db_name);
25?>
26--EXPECTF--
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]name10: Content String 10
38[key30]name30: Content String 30
39Total keys: 6
40Key 1 exists? N
41Key 2 exists? Y
42Key 3 exists? N
43Key 4 exists? Y
44Key 5 exists? Y
45Replace second key data
46bool(true)
47Content 2 replaced
48Read during write: not allowed
49Expected: Added a new data entry
50Expected: Failed to insert data for already used key
51Replace second key data
52bool(true)
53Delete "key4"
54bool(true)
55Fetch "key2": Content 2 replaced 2nd time
56Fetch "key number 6": The 6th value
57array(6) {
58  ["[key10]name10"]=>
59  string(17) "Content String 10"
60  ["[key30]name30"]=>
61  string(17) "Content String 30"
62  ["key number 6"]=>
63  string(13) "The 6th value"
64  ["key2"]=>
65  string(27) "Content 2 replaced 2nd time"
66  ["key5"]=>
67  string(23) "The last content string"
68  ["name9"]=>
69  string(16) "Content String 9"
70}
71=== RUNNING WITH DB LOCK (default) ===
72SAME OUTPUT AS PREVIOUS RUN
73=== RUNNING WITH NO LOCK ===
74SAME OUTPUT AS PREVIOUS RUN%S
75