xref: /PHP-5.3/ext/dba/tests/dba012.phpt (revision 321ca326)
1--TEST--
2DBA dba.default_handler tests
3--SKIPIF--
4<?php
5$handler = "flatfile";
6require_once(dirname(__FILE__) .'/skipif.inc');
7?>
8--INI--
9dba.default_handler=flatfile
10--FILE--
11<?php
12$handler = "flatfile";
13require_once(dirname(__FILE__) .'/test.inc');
14echo "database handler: $handler\n";
15
16echo "Test 1\n";
17
18ini_set('dba.default_handler', 'does_not_exist');
19
20var_dump(dba_open($db_filename, 'c'));
21
22echo "Test 2\n";
23
24ini_set('dba.default_handler', '');
25
26var_dump(dba_open($db_filename, 'n'));
27
28?>
29--CLEAN--
30<?php
31require(dirname(__FILE__) .'/clean.inc');
32?>
33--EXPECTF--
34database handler: flatfile
35Test 1
36
37Warning: ini_set(): No such handler: does_not_exist in %sdba012.php on line %d
38resource(%d) of type (dba)
39Test 2
40
41Warning: dba_open(%stest0.dbm,n): No default handler selected in %sdba012.php on line %d
42bool(false)
43