1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/odbc/tests/odbc_data_source_001.phpt
Christoph M. Becker c25b5c64d1 Fix test for cases where data sources are available
That `bool(false)` is a relict of adapting the test expectations to the
warning promotions.
2020-09-24 11:26:16 +02:00

30 lines
593 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);
try {
var_dump(odbc_data_source($conn, NULL));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
var_dump(odbc_data_source($conn, SQL_FETCH_FIRST));
?>
--EXPECTF--
odbc_data_source(): Argument #2 ($fetch_type) must be either SQL_FETCH_FIRST or SQL_FETCH_NEXT
array(%d) {
%a
}