1--TEST--
2DBA dba.default_handler tests
3--EXTENSIONS--
4dba
5--SKIPIF--
6<?php
7require_once __DIR__ . '/setup/setup_dba_tests.inc';
8check_skip('flatfile');
9?>
10--INI--
11dba.default_handler=flatfile
12--FILE--
13<?php
14$handler = "flatfile";
15$db_filename = 'ini_test_default_handler.db';
16echo "database handler: $handler\n";
17
18echo "Test 1\n";
19
20ini_set('dba.default_handler', 'does_not_exist');
21
22var_dump(dba_open($db_filename, 'c'));
23
24echo "Test 2\n";
25
26ini_set('dba.default_handler', '');
27
28var_dump(dba_open($db_filename, 'n'));
29
30?>
31--CLEAN--
32<?php
33require_once __DIR__ . '/setup/setup_dba_tests.inc';
34$db_name = 'ini_test_default_handler.db';
35cleanup_standard_db($db_name);
36?>
37--EXPECTF--
38database handler: flatfile
39Test 1
40
41Warning: ini_set(): No such handler: does_not_exist in %s on line %d
42resource(%d) of type (dba)
43Test 2
44
45Warning: dba_open(): No default handler selected in %s on line %d
46bool(false)
47