@@ -5,7 +5,25 @@ Verifies that the problem is no longer reproducible.
5
5
--ENV--
6
6
PHPT_EXEC=true
7
7
--SKIPIF--
8
- <?php require ('skipif_versions_old.inc ' ); ?>
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
+ ?>
9
27
--FILE--
10
28
<?php
11
29
@@ -19,22 +37,8 @@ function verifyFetchError()
19
37
20
38
require_once ('MsCommon.inc ' );
21
39
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
-
36
40
// Now connect with ColumnEncryption enabled
37
- $ connectionOptions = array_merge ( $ options , array ( 'ColumnEncryption ' => 'Enabled ' ) );
41
+ $ connectionOptions = array ( " Database " => $ database , " UID " => $ userName , " PWD " => $ userPassword , 'ColumnEncryption ' => 'Enabled ' );
38
42
$ conn = sqlsrv_connect ($ server , $ connectionOptions );
39
43
if ($ conn === false ) {
40
44
fatalError ("Failed to connect to $ server. " );
0 commit comments