Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For these AKV tests check env despite not AE connected #791

Merged
merged 1 commit into from
Jun 7, 2018
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
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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is MsHelper included by MsCommon.inc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


$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