renamed skipf and used AEQualified method instead

This commit is contained in:
Jenny Tam 2017-09-07 11:21:21 -07:00
parent a604abe871
commit 2143a9659b
13 changed files with 43 additions and 80 deletions

View file

@ -20,7 +20,7 @@ function IsAEQualified($conn)
$server_ver = $conn->getAttribute(PDO::ATTR_SERVER_VERSION);
$msodbcsql_maj = explode(".", $msodbcsql_ver)[0];
$msodbcsql_min = explode(".", $msodbcsql_ver)[1];
if ($msodbcsql_maj < 13 || explode('.', $server_ver)[0] < 13)
if ($msodbcsql_maj < 17 || explode('.', $server_ver)[0] < 13)
return false;
return true;
}

View file

@ -1,7 +1,7 @@
--TEST--
Fetch data from a prepopulated test table given a custom keystore provider
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
require( 'MsSetup.inc' );

View file

@ -1,7 +1,7 @@
--TEST--
Fetch encrypted data from a prepopulated test table given a custom keystore provider
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
require( 'MsSetup.inc' );

View file

@ -1,7 +1,7 @@
--TEST--
Connect using a custom keystore provider with some required inputs missing
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
require( 'MsSetup.inc' );

View file

@ -1,31 +0,0 @@
<?php
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
die("PDO driver cannot be loaded; skipping test.\n");
require_once( "MsSetup.inc" );
$conn = new PDO("sqlsrv:server = $server;", $uid, $pwd );
if( ! $conn )
{
echo ( "Error: could not connect during SKIPIF!" );
}
else
{
$attr = $conn->getAttribute(constant('PDO::ATTR_SERVER_VERSION'));
$version = substr($attr, 0, 2);
if ($version < 13)
{
// older than SQL Server 2016
die( "skip - feature not supported in this version of SQL Server." );
}
// check ODBC driver version
$attr = $conn->getAttribute(constant('PDO::ATTR_CLIENT_VERSION'));
$version = substr($attr['DriverVer'], 0, 2);
if ($version < 13)
{
// older than ODBC 13
die( "skip - feature not supported in this version of ODBC driver." );
}
}
?>

View file

@ -0,0 +1,18 @@
<?php
if (! extension_loaded( 'pdo' ) || ! extension_loaded( 'pdo_sqlsrv' ))
die( "PDO driver cannot be loaded; skipping test.\n" );
require_once( "MsSetup.inc" );
require_once( "MsCommon.inc" );
$conn = new PDO( "sqlsrv:server = $server;", $uid, $pwd );
if( ! $conn )
{
echo( "Error: could not connect during SKIPIF!" );
}
else if(! IsAEQualified($conn))
{
die( "skip - AE feature not supported in the current environment." );
}
?>

View file

@ -86,7 +86,7 @@ function IsAEQualified($conn)
$server_ver = sqlsrv_server_info($conn)['SQLServerVersion'];
$msodbcsql_maj = explode(".", $msodbcsql_ver)[0];
$msodbcsql_min = explode(".", $msodbcsql_ver)[1];
if ($msodbcsql_maj < 13 || explode('.', $server_ver)[0] < 13)
if ($msodbcsql_maj < 17 || explode('.', $server_ver)[0] < 13)
return false;
return true;
}

View file

@ -1,40 +0,0 @@
<?php
if (!extension_loaded("sqlsrv"))
die("skip extension not loaded");
require_once( "MsSetup.inc" );
$connectionInfo = array( "UID"=>$userName, "PWD"=>$userPassword );
$conn = sqlsrv_connect( $server, $connectionInfo );
if( ! $conn )
{
echo ( "Error: could not connect during SKIPIF!" );
}
else
{
$server_info = sqlsrv_server_info( $conn );
if( $server_info )
{
// check SQL Server version
$version = substr($server_info['SQLServerVersion'], 0, 2);
if ($version < 13)
{
// older than SQL Server 2016
die( "skip - feature not supported in this version of SQL Server." );
}
}
$client_info = sqlsrv_client_info( $conn );
if( $client_info )
{
// check ODBC driver version
$version = substr($client_info['DriverVer'], 0, 2);
if ($version < 13)
{
// older than ODBC 13
die( "skip - feature not supported in this version of ODBC driver." );
}
}
}
?>

View file

@ -0,0 +1,16 @@
<?php
if(! extension_loaded( "sqlsrv" ) )
die( "skip extension not loaded" );
require_once( "MsCommon.inc" );
$conn = Connect();
if( ! $conn )
{
echo( "Error: could not connect during SKIPIF!" );
}
else if(! IsAEQualified( $conn ) )
{
die( "skip - AE feature not supported in the current environment." );
}
?>

View file

@ -1,7 +1,7 @@
--TEST--
Fetch data from a prepopulated test table given a custom keystore provider
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
sqlsrv_configure( 'WarningsReturnAsErrors', 1 );

View file

@ -1,7 +1,7 @@
--TEST--
Fetch encrypted data from a prepopulated test table given a custom keystore provider
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
sqlsrv_configure( 'WarningsReturnAsErrors', 1 );

View file

@ -1,7 +1,7 @@
--TEST--
Connect using a custom keystore provider with some required inputs missing
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php

View file

@ -1,7 +1,7 @@
--TEST--
Test simple insert, fetch and update with ColumnEncryption enabled and a custome keystore provider
--SKIPIF--
<?php require('skipif_server_old.inc'); ?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php
function CreatePatientsTable()