Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/functional/pdo_sqlsrv/pdo_569_query_varcharmax.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ 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);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Expand Down
17 changes: 16 additions & 1 deletion test/functional/sqlsrv/srv_569_query_varcharmax.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,22 @@ function verifyFetchError()

require_once('MsCommon.inc');

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