php-sqlsrv/test/functional/sqlsrv/TC22_ClientInfo.phpt

54 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-05-04 01:00:31 +02:00
--TEST--
Client Info Test
--DESCRIPTION--
2017-10-11 01:54:20 +02:00
Verifies the functionality of "sqlsrv_client_info".
2017-05-04 01:00:31 +02:00
--ENV--
PHPT_EXEC=true
--SKIPIF--
<?php require('skipif_versions_old.inc'); ?>
2017-05-04 01:00:31 +02:00
--FILE--
<?php
require_once('MsCommon.inc');
2017-05-04 01:00:31 +02:00
2017-10-11 01:54:20 +02:00
function clientInfo()
2017-05-04 01:00:31 +02:00
{
$testName = "Connection - Client Info";
startTest($testName);
2017-05-04 01:00:31 +02:00
setup();
$conn1 = connect();
2017-05-04 01:00:31 +02:00
$clientinfo1 = sqlsrv_client_info($conn1);
$count1 = count($clientinfo1);
if ($count1 != 4) {
2017-05-04 01:00:31 +02:00
die("Unexpected size for client_info array: ".$count1);
}
$driverName = isWindows() ? 'DriverDllName' : 'DriverName';
2017-10-11 01:54:20 +02:00
showInfo($clientinfo1, 'ExtensionVer');
showInfo($clientinfo1, $driverName);
showInfo($clientinfo1, 'DriverVer');
showInfo($clientinfo1, 'DriverODBCVer');
2017-05-04 01:00:31 +02:00
sqlsrv_close($conn1);
endTest($testName);
2017-05-04 01:00:31 +02:00
}
2017-10-11 01:54:20 +02:00
function showInfo($clientInfo, $infoTag)
2017-05-04 01:00:31 +02:00
{
$info = $clientInfo[$infoTag];
trace("$infoTag\t= $info\n");
2017-05-04 01:00:31 +02:00
}
2017-10-11 01:54:20 +02:00
try {
clientInfo();
} catch (Exception $e) {
echo $e->getMessage();
2017-05-04 01:00:31 +02:00
}
?>
--EXPECT--
Test "Connection - Client Info" completed successfully.