Skip to content

Commit

Permalink
Revert "Used different skipif conditions for these two tests that req…
Browse files Browse the repository at this point in the history
…uire AE connections (#977)" (#980)

This reverts commit ee3c85a.
  • Loading branch information
yitam authored Apr 25, 2019
1 parent a8e1138 commit e8d1389
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 40 deletions.
31 changes: 11 additions & 20 deletions test/functional/pdo_sqlsrv/pdo_569_query_varcharmax.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,23 @@ Verifies that the problem is no longer reproducible.
--ENV--
PHPT_EXEC=true
--SKIPIF--
<?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.");
}
?>
<?php require('skipif_mid-refactor.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
require_once("MsCommon_mid-refactor.inc");

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
$connectionInfo = "ColumnEncryption = Enabled;";
$conn = new PDO("sqlsrv:server = $server; database=$databaseName; $connectionInfo", $uid, $pwd);
Expand Down
36 changes: 16 additions & 20 deletions test/functional/sqlsrv/srv_569_query_varcharmax.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,7 @@ Verifies that the problem is no longer reproducible.
--ENV--
PHPT_EXEC=true
--SKIPIF--
<?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.");
}
?>
<?php require('skipif_versions_old.inc'); ?>
--FILE--
<?php

Expand All @@ -37,8 +19,22 @@ function verifyFetchError()

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
$connectionOptions = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword, 'ColumnEncryption' => 'Enabled');
$connectionOptions = array_merge($options, array('ColumnEncryption' => 'Enabled'));
$conn = sqlsrv_connect($server, $connectionOptions);
if ($conn === false) {
fatalError("Failed to connect to $server.");
Expand Down

0 comments on commit e8d1389

Please sign in to comment.