renamed skipf and used AEQualified method instead
This commit is contained in:
parent
a604abe871
commit
2143a9659b
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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' );
|
||||
|
|
|
@ -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' );
|
||||
|
|
|
@ -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' );
|
||||
|
|
|
@ -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." );
|
||||
}
|
||||
}
|
||||
?>
|
18
test/functional/pdo_sqlsrv/skipif_versions_old.inc
Normal file
18
test/functional/pdo_sqlsrv/skipif_versions_old.inc
Normal 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." );
|
||||
}
|
||||
?>
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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." );
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
16
test/functional/sqlsrv/skipif_versions_old.inc
Normal file
16
test/functional/sqlsrv/skipif_versions_old.inc
Normal 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." );
|
||||
}
|
||||
?>
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue