1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/dba/tests/dba012.phpt
T
George Peter Banyard 7db32add9b Refactor dba_(p)open() to be more sensible (#7610)
Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
2021-11-06 23:09:40 +00:00

45 lines
795 B
PHP

--TEST--
DBA dba.default_handler tests
--EXTENSIONS--
dba
--SKIPIF--
<?php
$handler = "flatfile";
require_once(__DIR__ .'/skipif.inc');
?>
--INI--
dba.default_handler=flatfile
--FILE--
<?php
$handler = "flatfile";
require_once(__DIR__ .'/test.inc');
echo "database handler: $handler\n";
echo "Test 1\n";
ini_set('dba.default_handler', 'does_not_exist');
var_dump(dba_open($db_filename, 'c'));
echo "Test 2\n";
ini_set('dba.default_handler', '');
var_dump(dba_open($db_filename, 'n'));
?>
--CLEAN--
<?php
require(__DIR__ .'/clean.inc');
?>
--EXPECTF--
database handler: flatfile
Test 1
Warning: ini_set(): No such handler: does_not_exist in %sdba012.php on line %d
resource(%d) of type (dba)
Test 2
Warning: dba_open(): No default handler selected in %sdba012.php on line %d
bool(false)