added client info tests
This commit is contained in:
parent
0782c56b41
commit
4532c72eab
22
test/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt
Normal file
22
test/pdo_sqlsrv/pdo_getAttribute_clientInfo.phpt
Normal file
|
@ -0,0 +1,22 @@
|
|||
--TEST--
|
||||
Test client info by calling PDO::getAttribute with PDO::ATTR_CLIENT_VERSION
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("autonomous_setup.php");
|
||||
|
||||
$conn = new PDO( "sqlsrv:server=$serverName", "$username", "$password" );
|
||||
|
||||
// An example using PDO::ATTR_CLIENT_VERSION
|
||||
print_r($conn->getAttribute( PDO::ATTR_CLIENT_VERSION ));
|
||||
|
||||
//free the connection
|
||||
$conn=null;
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Array
|
||||
\(
|
||||
\[(DriverDllName|DriverName)\] => (msodbcsql1[1-9].dll|libmsodbcsql-[1-9]{2}.[0-9].so.[0-9].[0-9])
|
||||
\[DriverODBCVer\] => [0-9]{1,2}\.[0-9]{1,2}
|
||||
\[DriverVer\] => [0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}
|
||||
\[ExtensionVer\] => [0-9]\.[0-9]\.[0-9](\-((rc)|(preview))(\.[0-9]+)?)?(\+[0-9]+)?
|
||||
\)
|
25
test/sqlsrv/sqlsrv_client_info.phpt
Normal file
25
test/sqlsrv/sqlsrv_client_info.phpt
Normal file
|
@ -0,0 +1,25 @@
|
|||
--TEST--
|
||||
Test sqlsrv_client_info
|
||||
--SKIPIF--
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("autonomous_setup.php");
|
||||
$conn = sqlsrv_connect( $serverName, $connectionInfo);
|
||||
if( !$conn ) {
|
||||
die( print_r( sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
$client_info = sqlsrv_client_info( $conn );
|
||||
var_dump( $client_info );
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
array\(4\) {
|
||||
\[\"(DriverDllName|DriverName)\"\]=>
|
||||
(string\(15\) \"msodbcsql1[1-9].dll\"|string\(24\) \"libmsodbcsql-[1-9]{2}.[0-9].so.[0-9].[0-9]\")
|
||||
\[\"DriverODBCVer\"\]=>
|
||||
string\(5\) \"[0-9]{1,2}\.[0-9]{1,2}\"
|
||||
\[\"DriverVer\"\]=>
|
||||
string\(10\) \"[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}\"
|
||||
\[\"ExtensionVer\"\]=>
|
||||
string\([0-9]+\) \"[0-9]\.[0-9]\.[0-9](\-((rc)|(preview))(\.[0-9]+)?)?(\+[0-9]+)?"
|
||||
}
|
Loading…
Reference in a new issue