Skip to content

Commit

Permalink
Merge pull request #791 from yitam/fixODBC13tests
Browse files Browse the repository at this point in the history
For these AKV tests check env despite not AE connected
  • Loading branch information
yitam authored Jun 7, 2018
2 parents 5a66610 + f6e450b commit 90c6443
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test client ID/secret credentials for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_mid-refactor.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('pdo_ae_azure_key_vault_common.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test connection keywords for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_mid-refactor.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('pdo_ae_azure_key_vault_common.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test username/password credentials for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_mid-refactor.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('pdo_ae_azure_key_vault_common.php');
Expand Down
15 changes: 15 additions & 0 deletions test/functional/pdo_sqlsrv/skipif_not_akv.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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");

$dsn = getDSN($server, null);
$conn = new PDO($dsn, $uid, $pwd);
if (! $conn) {
echo("Error: could not connect during SKIPIF!");
} elseif (!isAEQualified($conn)) {
die("skip - AE feature not supported in the current environment.");
}
15 changes: 15 additions & 0 deletions test/functional/sqlsrv/skipif_not_akv.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

if (! extension_loaded("sqlsrv")) {
die("skip extension not loaded");
}

require_once('MsCommon.inc');

$conn = AE\connect();
if (! $conn) {
echo("Error: could not connect during SKIPIF!");
} elseif (!AE\isQualified($conn)) {
die("skip - AE feature not supported in the current environment.");
}
?>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test client ID/secret credentials for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_versions_old.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('sqlsrv_ae_azure_key_vault_common.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test connection keywords for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_versions_old.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('sqlsrv_ae_azure_key_vault_common.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test username/password credentials for Azure Key Vault for Always Encrypted.
--SKIPIF--
<?php require('skipif_versions_old.inc'); ?>
<?php require('skipif_not_akv.inc'); ?>
--FILE--
<?php
require_once('sqlsrv_ae_azure_key_vault_common.php');
Expand Down

0 comments on commit 90c6443

Please sign in to comment.