Skip to content

Commit 3d6ee6a

Browse files
committed
WIP pgsql test fix
1 parent 162b037 commit 3d6ee6a

File tree

1 file changed

+49
-29
lines changed

1 file changed

+49
-29
lines changed

ext/pgsql/tests/80_bug14383.phpt

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ dba
55
pgsql
66
--SKIPIF--
77
<?php
8-
require_once(__DIR__.'/../../dba/tests/skipif.inc');
8+
require_once dirname(__DIR__, 2) . '/dba/tests/setup/setup_dba_tests.inc';
9+
check_skip_any();
910
require_once('skipif.inc');
1011
?>
1112
--FILE--
@@ -18,46 +19,65 @@ if (!$dbh) {
1819
}
1920
pg_close($dbh);
2021

21-
require_once(__DIR__.'/../../dba/tests/test.inc');
22-
require_once(__DIR__.'/../../dba/tests/dba_handler.inc');
22+
require_once dirname(__DIR__, 2) . '/dba/tests/setup/setup_dba_tests.inc';
23+
$name = 'bug14383.db';
2324

25+
$handler = get_any_handler($name);
26+
run_standard_tests($handler, $name);
2427
?>
2528
--CLEAN--
2629
<?php
27-
require_once(__DIR__.'/../../dba/tests/clean.inc');
30+
require_once dirname(__DIR__, 2) . '/dba/tests/setup/setup_dba_tests.inc';
31+
$name = 'bug14383.db';
32+
cleanup_standard_db($name);
2833
?>
2934
--EXPECTF--
30-
database handler: %s
31-
3NYNYY
32-
Content String 2
33-
Content 2 replaced
34-
Read during write:%sallowed
35-
"key number 6" written
36-
Failed to write "key number 6" 2nd time
37-
Content 2 replaced 2nd time
38-
The 6th value
39-
array(3) {
40-
["key number 6"]=>
41-
string(13) "The 6th value"
42-
["key2"]=>
43-
string(27) "Content 2 replaced 2nd time"
44-
["key5"]=>
45-
string(23) "The last content string"
46-
}
47-
--NO-LOCK--
48-
3NYNYY
49-
Content String 2
35+
Using handler: "%s"
36+
=== RUNNING WITH FILE LOCK ===
37+
Remove key 1 and 3
38+
bool(true)
39+
bool(true)
40+
Try to remove key 1 again
41+
bool(false)
42+
key2: Content String 2
43+
key4: Another Content String
44+
key5: The last content string
45+
name9: Content String 9
46+
[key10]name10: Content String 10
47+
[key30]name30: Content String 30
48+
Total keys: 6
49+
Key 1 exists? N
50+
Key 2 exists? Y
51+
Key 3 exists? N
52+
Key 4 exists? Y
53+
Key 5 exists? Y
54+
Replace second key data
55+
bool(true)
5056
Content 2 replaced
5157
Read during write: not allowed
52-
"key number 6" written
53-
Failed to write "key number 6" 2nd time
54-
Content 2 replaced 2nd time
55-
The 6th value
56-
array(3) {
58+
Expected: Added a new data entry
59+
Expected: Failed to insert data for already used key
60+
Replace second key data
61+
bool(true)
62+
Delete "key4"
63+
bool(true)
64+
Fetch "key2": Content 2 replaced 2nd time
65+
Fetch "key number 6": The 6th value
66+
array(6) {
67+
["[key10]name10"]=>
68+
string(17) "Content String 10"
69+
["[key30]name30"]=>
70+
string(17) "Content String 30"
5771
["key number 6"]=>
5872
string(13) "The 6th value"
5973
["key2"]=>
6074
string(27) "Content 2 replaced 2nd time"
6175
["key5"]=>
6276
string(23) "The last content string"
77+
["name9"]=>
78+
string(16) "Content String 9"
6379
}
80+
=== RUNNING WITH DB LOCK (default) ===
81+
SAME OUTPUT AS PREVIOUS RUN
82+
=== RUNNING WITH NO LOCK ===
83+
SAME OUTPUT AS PREVIOUS RUN (modulo read during write due to no lock)

0 commit comments

Comments
 (0)