Skip to content

Commit e8d1389

Browse files
authored
Revert "Used different skipif conditions for these two tests that require AE connections (#977)" (#980)
This reverts commit ee3c85a.
1 parent a8e1138 commit e8d1389

File tree

2 files changed

+27
-40
lines changed

2 files changed

+27
-40
lines changed

test/functional/pdo_sqlsrv/pdo_569_query_varcharmax.phpt

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,23 @@ Verifies that the problem is no longer reproducible.
55
--ENV--
66
PHPT_EXEC=true
77
--SKIPIF--
8-
<?php
9-
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv')) {
10-
die("PDO driver cannot be loaded; skipping test.\n");
11-
}
12-
13-
require_once("MsSetup.inc");
14-
require_once("MsCommon_mid-refactor.inc");
15-
16-
// This test requires to connect with the Always Encrypted feature
17-
// First check if the system is qualified to run this test
18-
$dsn = getDSN($server, null);
19-
$conn = new PDO($dsn, $uid, $pwd);
20-
if (! $conn) {
21-
die("Error: could not connect during SKIPIF!");
22-
}
23-
24-
if (!isAEQualified($conn)) {
25-
die("skip - AE feature not supported in the current environment.");
26-
}
27-
?>
8+
<?php require('skipif_mid-refactor.inc'); ?>
289
--FILE--
2910
<?php
3011
require_once("MsSetup.inc");
3112
require_once("MsCommon_mid-refactor.inc");
3213

3314
try {
15+
// This test requires to connect with the Always Encrypted feature
16+
// First check if the system is qualified to run this test
17+
$dsn = getDSN($server, null);
18+
$conn = new PDO($dsn, $uid, $pwd);
19+
if (!isAEQualified($conn)) {
20+
echo "Done\n";
21+
return;
22+
}
23+
unset($conn);
24+
3425
// Now connect with ColumnEncryption enabled
3526
$connectionInfo = "ColumnEncryption = Enabled;";
3627
$conn = new PDO("sqlsrv:server = $server; database=$databaseName; $connectionInfo", $uid, $pwd);

test/functional/sqlsrv/srv_569_query_varcharmax.phpt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,7 @@ Verifies that the problem is no longer reproducible.
55
--ENV--
66
PHPT_EXEC=true
77
--SKIPIF--
8-
<?php
9-
if (! extension_loaded("sqlsrv")) {
10-
die("skip extension not loaded");
11-
}
12-
13-
require_once('MsCommon.inc');
14-
15-
// This test requires to connect with the Always Encrypted feature
16-
// First check if the system is qualified to run this test
17-
$options = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword);
18-
$conn = sqlsrv_connect($server, $options);
19-
if ($conn === false) {
20-
die("Error: could not connect during SKIPIF!");
21-
}
22-
23-
if (!AE\isQualified($conn)) {
24-
die("skip - AE feature not supported in the current environment.");
25-
}
26-
?>
8+
<?php require('skipif_versions_old.inc'); ?>
279
--FILE--
2810
<?php
2911

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

3820
require_once('MsCommon.inc');
3921

22+
// This test requires to connect with the Always Encrypted feature
23+
// First check if the system is qualified to run this test
24+
$options = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword);
25+
$conn = sqlsrv_connect($server, $options);
26+
if ($conn === false) {
27+
fatalError("Failed to connect to $server.");
28+
}
29+
30+
if (!AE\isQualified($conn)) {
31+
echo "Done\n";
32+
return;
33+
}
34+
sqlsrv_close($conn);
35+
4036
// Now connect with ColumnEncryption enabled
41-
$connectionOptions = array("Database" => $database, "UID" => $userName, "PWD" => $userPassword, 'ColumnEncryption' => 'Enabled');
37+
$connectionOptions = array_merge($options, array('ColumnEncryption' => 'Enabled'));
4238
$conn = sqlsrv_connect($server, $connectionOptions);
4339
if ($conn === false) {
4440
fatalError("Failed to connect to $server.");

0 commit comments

Comments
 (0)