Skip to content

Commit 28a7860

Browse files
authored
Added driver to the skipif conditions (#831)
1 parent 909d1fa commit 28a7860

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

test/functional/pdo_sqlsrv/skipif_version_less_than_2k14.inc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ if (!extension_loaded("pdo_sqlsrv")) {
77
die("skip Extension not loaded");
88
}
99

10-
$is_win = ( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' );
10+
$is_win = (strtoupper(substr(php_uname('s'),0,3)) === 'WIN');
1111

12-
require_once( "MsSetup.inc" );
12+
require_once("MsSetup.inc");
1313

14-
$conn = new PDO( "sqlsrv:server = $server ;", $uid, $pwd );
14+
$conn = new PDO("sqlsrv:server = $server; driver=$driver;", $uid, $pwd);
1515
if ($conn === false) {
16-
die( "skip Could not connect during SKIPIF." );
16+
die("skip Could not connect during SKIPIF.");
1717
}
1818

1919
$msodbcsql_ver = $conn->getAttribute(PDO::ATTR_CLIENT_VERSION)["DriverVer"];
@@ -33,11 +33,11 @@ if (!$is_win) {
3333
// Get SQL Server Version
3434
// Exclude this check if running on Azure
3535
if (!$daasMode) {
36-
$stmt = $conn->query( "SELECT @@VERSION" );
36+
$stmt = $conn->query("SELECT @@VERSION");
3737
if ($stmt) {
3838
$ver_string = $stmt->fetch(PDO::FETCH_NUM)[0];
3939
} else {
40-
die( "skip Could not fetch SQL Server version during SKIPIF.");
40+
die("skip Could not fetch SQL Server version during SKIPIF.");
4141
}
4242

4343
$version = explode(' ', $ver_string);

test/functional/sqlsrv/skipif_version_less_than_2k14.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ if (!extension_loaded("sqlsrv")) {
77
die("skip Extension not loaded");
88
}
99

10-
$is_win = ( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' );
10+
$is_win = (strtoupper(substr(php_uname('s'),0,3)) === 'WIN');
1111

12-
require_once( "MsSetup.inc" );
12+
require_once("MsSetup.inc");
1313

14-
$connectionInfo = array( "UID"=>$userName, "PWD"=>$userPassword );
14+
$connectionInfo = array("UID"=>$userName, "PWD"=>$userPassword, "Driver" => $driver);
1515

16-
$conn = sqlsrv_connect( $server, $connectionInfo );
16+
$conn = sqlsrv_connect($server, $connectionInfo);
1717
if ($conn === false) {
18-
die( "skip Could not connect during SKIPIF." );
18+
die("skip Could not connect during SKIPIF.");
1919
}
2020

2121
$msodbcsql_ver = sqlsrv_client_info($conn)["DriverVer"];
@@ -35,9 +35,9 @@ if (!$is_win) {
3535
// Get SQL Server version
3636
// Exclude this check if running on Azure
3737
if (!$daasMode) {
38-
$stmt = sqlsrv_query( $conn, "SELECT @@VERSION" );
38+
$stmt = sqlsrv_query($conn, "SELECT @@VERSION");
3939
if (sqlsrv_fetch($stmt)) {
40-
$ver_string = sqlsrv_get_field( $stmt, 0 );
40+
$ver_string = sqlsrv_get_field($stmt, 0);
4141
} else {
4242
die("skip Could not fetch SQL Server version.");
4343
}

0 commit comments

Comments
 (0)