1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/dba/tests/dba_array_keys_var_non_string.phpt
George Peter Banyard eddab74021 Improve DBA test suite (#8904)
Generalises tests for all the different drivers.
Run the general test for the various drivers.

This allows support for parallel testing as the tests now do not rely on the same DB file.
2022-07-28 19:36:04 +01:00

56 lines
833 B
PHP

--TEST--
DBA check behaviour of key as an array with non string elements
--EXTENSIONS--
dba
--SKIPIF--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
check_skip_any();
?>
--FILE--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$name = 'array_keys_non_string.db';
$db = get_any_db($name);
$key = [5, 5.21];
var_dump($key);
var_dump(dba_insert($key, 'Test', $db));
var_dump($key);
var_dump(dba_fetch($key, $db));
var_dump($key);
dba_close($db);
?>
--CLEAN--
<?php
require_once __DIR__ . '/setup/setup_dba_tests.inc';
$db_name = 'array_keys_non_string.db';
cleanup_standard_db($db_name);
?>
--EXPECTF--
Using handler: "%s"
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}
bool(true)
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}
string(4) "Test"
array(2) {
[0]=>
int(5)
[1]=>
float(5.21)
}