Used different skipif conditions for these two tests that require AE connections (#977)
This commit is contained in:
parent
a3456cdbcb
commit
ee3c85afa8
|
@ -5,23 +5,32 @@ Verifies that the problem is no longer reproducible.
|
||||||
--ENV--
|
--ENV--
|
||||||
PHPT_EXEC=true
|
PHPT_EXEC=true
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif_mid-refactor.inc'); ?>
|
<?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_mid-refactor.inc");
|
||||||
|
|
||||||
|
// This test requires to connect with the Always Encrypted feature
|
||||||
|
// First check if the system is qualified to run this test
|
||||||
|
$dsn = getDSN($server, null);
|
||||||
|
$conn = new PDO($dsn, $uid, $pwd);
|
||||||
|
if (! $conn) {
|
||||||
|
die("Error: could not connect during SKIPIF!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isAEQualified($conn)) {
|
||||||
|
die("skip - AE feature not supported in the current environment.");
|
||||||
|
}
|
||||||
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
require_once("MsCommon_mid-refactor.inc");
|
require_once("MsCommon_mid-refactor.inc");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// This test requires to connect with the Always Encrypted feature
|
|
||||||
// First check if the system is qualified to run this test
|
|
||||||
$dsn = getDSN($server, null);
|
|
||||||
$conn = new PDO($dsn, $uid, $pwd);
|
|
||||||
if (!isAEQualified($conn)) {
|
|
||||||
echo "Done\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
unset($conn);
|
|
||||||
|
|
||||||
// Now connect with ColumnEncryption enabled
|
// Now connect with ColumnEncryption enabled
|
||||||
$connectionInfo = "ColumnEncryption = Enabled;";
|
$connectionInfo = "ColumnEncryption = Enabled;";
|
||||||
$conn = new PDO("sqlsrv:server = $server; database=$databaseName; $connectionInfo", $uid, $pwd);
|
$conn = new PDO("sqlsrv:server = $server; database=$databaseName; $connectionInfo", $uid, $pwd);
|
||||||
|
|
|
@ -5,7 +5,25 @@ Verifies that the problem is no longer reproducible.
|
||||||
--ENV--
|
--ENV--
|
||||||
PHPT_EXEC=true
|
PHPT_EXEC=true
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif_versions_old.inc'); ?>
|
<?php
|
||||||
|
if (! extension_loaded("sqlsrv")) {
|
||||||
|
die("skip extension not loaded");
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once('MsCommon.inc');
|
||||||
|
|
||||||
|
// This test requires to connect with the Always Encrypted feature
|
||||||
|
// First check if the system is qualified to run this test
|
||||||
|
$options = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword);
|
||||||
|
$conn = sqlsrv_connect($server, $options);
|
||||||
|
if ($conn === false) {
|
||||||
|
die("Error: could not connect during SKIPIF!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!AE\isQualified($conn)) {
|
||||||
|
die("skip - AE feature not supported in the current environment.");
|
||||||
|
}
|
||||||
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -19,22 +37,8 @@ function verifyFetchError()
|
||||||
|
|
||||||
require_once('MsCommon.inc');
|
require_once('MsCommon.inc');
|
||||||
|
|
||||||
// This test requires to connect with the Always Encrypted feature
|
|
||||||
// First check if the system is qualified to run this test
|
|
||||||
$options = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword);
|
|
||||||
$conn = sqlsrv_connect($server, $options);
|
|
||||||
if ($conn === false) {
|
|
||||||
fatalError("Failed to connect to $server.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!AE\isQualified($conn)) {
|
|
||||||
echo "Done\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
// Now connect with ColumnEncryption enabled
|
// Now connect with ColumnEncryption enabled
|
||||||
$connectionOptions = array_merge($options, array('ColumnEncryption' => 'Enabled'));
|
$connectionOptions = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword, 'ColumnEncryption' => 'Enabled');
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn === false) {
|
||||||
fatalError("Failed to connect to $server.");
|
fatalError("Failed to connect to $server.");
|
||||||
|
|
Loading…
Reference in a new issue