From ebbb676b8ac9e167b736d68f61345fa363f5d9fb Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Thu, 8 Feb 2018 09:51:52 -0800 Subject: [PATCH] Fixed the failing tests --- test/functional/pdo_sqlsrv/pdo_connect_driver.phpt | 5 +++-- test/functional/pdo_sqlsrv/skipif_mid-refactor.inc | 3 +-- test/functional/sqlsrv/skipif_versions_old.inc | 4 +--- test/functional/sqlsrv/sqlsrv_connect_driver.phpt | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt index b9e3f5ac..91b1412c 100644 --- a/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt +++ b/test/functional/pdo_sqlsrv/pdo_connect_driver.phpt @@ -105,10 +105,11 @@ function testInvalidValues() function testEncryptedWithODBC() { // Skip this function if running outside Windows - if (!strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') { + if (!(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) { return; } - + return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); + global $msodbcsqlMaj, $server, $uid, $pwd; $value = "ODBC Driver 13 for SQL Server"; diff --git a/test/functional/pdo_sqlsrv/skipif_mid-refactor.inc b/test/functional/pdo_sqlsrv/skipif_mid-refactor.inc index a15c53e8..a8e0e7d6 100644 --- a/test/functional/pdo_sqlsrv/skipif_mid-refactor.inc +++ b/test/functional/pdo_sqlsrv/skipif_mid-refactor.inc @@ -6,13 +6,12 @@ if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv')) { require_once("MsSetup.inc"); require_once("MsCommon_mid-refactor.inc"); - $dsn = getDSN($server, null); $conn = new PDO($dsn, $uid, $pwd); if (! $conn) { echo("Error: could not connect during SKIPIF!"); } elseif (isColEncrypted()) { - if (!strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') { + if (!(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) { die( "Skip, AE test on windows only." ); } diff --git a/test/functional/sqlsrv/skipif_versions_old.inc b/test/functional/sqlsrv/skipif_versions_old.inc index 2ed78d62..3605fb9f 100644 --- a/test/functional/sqlsrv/skipif_versions_old.inc +++ b/test/functional/sqlsrv/skipif_versions_old.inc @@ -4,15 +4,13 @@ if (! extension_loaded("sqlsrv")) { die("skip extension not loaded"); } -if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, AE test on windows only." ); - require_once('MsCommon.inc'); $conn = AE\connect(); if (! $conn) { echo("Error: could not connect during SKIPIF!"); } elseif (AE\isColEncrypted()) { - if (!strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') { + if (!isWindows()) { die( "Skip, AE test on windows only." ); } diff --git a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt index e539b4c9..b7b51ad6 100644 --- a/test/functional/sqlsrv/sqlsrv_connect_driver.phpt +++ b/test/functional/sqlsrv/sqlsrv_connect_driver.phpt @@ -103,7 +103,7 @@ function testInvalidValues($msodbcsqlMaj, $server, $connectionOptions) function testEncryptedWithODBC($msodbcsqlMaj, $server, $connectionOptions) { // Skip this function if running outside Windows - if (!strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN') { + if (!isWindows()) { return; }