php-src/ext/odbc/tests/odbc_data_source_001.phpt
Gabriel Caruso ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00

31 lines
621 B
PHP

--TEST--
odbc_data_source(): Basic test
--SKIPIF--
<?php
include 'skipif.inc';
if (odbc_data_source($conn, SQL_FETCH_FIRST) === NULL) {
die("skip no data sources defined on this system");
}
?>
--FILE--
<?php
include 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
var_dump(odbc_data_source($conn, NULL));
var_dump(odbc_data_source($conn, ''));
var_dump(odbc_data_source($conn, SQL_FETCH_FIRST));
?>
--EXPECTF--
Warning: odbc_data_source(): Invalid fetch type (0) in %s on line %d
bool(false)
Warning: odbc_data_source() expects parameter 2 to be int, string given in %s on line %d
NULL
array(%d) {
%a
}