Fixed the failing tests

This commit is contained in:
Jenny Tam 2018-02-08 09:51:52 -08:00
parent bad65817e1
commit ebbb676b8a
4 changed files with 6 additions and 8 deletions

View file

@ -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";

View file

@ -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." );
}

View file

@ -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." );
}

View file

@ -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;
}