Skip to content

Added driver to the skipif conditions #831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/functional/pdo_sqlsrv/skipif_version_less_than_2k14.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ if (!extension_loaded("pdo_sqlsrv")) {
die("skip Extension not loaded");
}

$is_win = ( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' );
$is_win = (strtoupper(substr(php_uname('s'),0,3)) === 'WIN');

require_once( "MsSetup.inc" );
require_once("MsSetup.inc");

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

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

$version = explode(' ', $ver_string);
Expand Down
14 changes: 7 additions & 7 deletions test/functional/sqlsrv/skipif_version_less_than_2k14.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ if (!extension_loaded("sqlsrv")) {
die("skip Extension not loaded");
}

$is_win = ( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' );
$is_win = (strtoupper(substr(php_uname('s'),0,3)) === 'WIN');

require_once( "MsSetup.inc" );
require_once("MsSetup.inc");

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

$conn = sqlsrv_connect( $server, $connectionInfo );
$conn = sqlsrv_connect($server, $connectionInfo);
if ($conn === false) {
die( "skip Could not connect during SKIPIF." );
die("skip Could not connect during SKIPIF.");
}

$msodbcsql_ver = sqlsrv_client_info($conn)["DriverVer"];
Expand All @@ -35,9 +35,9 @@ if (!$is_win) {
// Get SQL Server version
// Exclude this check if running on Azure
if (!$daasMode) {
$stmt = sqlsrv_query( $conn, "SELECT @@VERSION" );
$stmt = sqlsrv_query($conn, "SELECT @@VERSION");
if (sqlsrv_fetch($stmt)) {
$ver_string = sqlsrv_get_field( $stmt, 0 );
$ver_string = sqlsrv_get_field($stmt, 0);
} else {
die("skip Could not fetch SQL Server version.");
}
Expand Down