Made the tests more robust
This commit is contained in:
parent
dad6e4c245
commit
84e7d67aec
|
@ -1,5 +1,8 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test various encrypt attributes
|
Test various encrypt attributes
|
||||||
|
--DESCRIPTION--
|
||||||
|
This test does not test if any connection is successful but mainly test if the Encrypt keyword takes
|
||||||
|
different attributes.
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc');?>
|
<?php require('skipif.inc');?>
|
||||||
--FILE--
|
--FILE--
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test various encrypt attributes
|
Test various encrypt attributes
|
||||||
|
--DESCRIPTION--
|
||||||
|
This test does not test if any connection is successful but mainly test if the Encrypt keyword takes
|
||||||
|
different attributes.
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc');?>
|
<?php require('skipif.inc');?>
|
||||||
--FILE--
|
--FILE--
|
||||||
|
@ -9,53 +12,43 @@ require_once 'MsSetup.inc';
|
||||||
echo 'Test case 1' . PHP_EOL;
|
echo 'Test case 1' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => true, 'TrustServerCertificate' => true);
|
$connectionOptions = array('Encrypt' => true, 'TrustServerCertificate' => true);
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
echo 'Test case 2' . PHP_EOL;
|
echo 'Test case 2' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => 1, 'TrustServerCertificate' => true);
|
$connectionOptions = array('Encrypt' => 1, 'TrustServerCertificate' => true);
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
echo 'Test case 3' . PHP_EOL;
|
echo 'Test case 3' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => "yes", 'TrustServerCertificate' => true);
|
$connectionOptions = array('Encrypt' => "yes", 'TrustServerCertificate' => true);
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
echo 'Test case 4' . PHP_EOL;
|
echo 'Test case 4' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => "no");
|
$connectionOptions = array('Encrypt' => "no");
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
echo 'Test case 5' . PHP_EOL;
|
echo 'Test case 5' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => false);
|
$connectionOptions = array('Encrypt' => false);
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlsrv_close($conn);
|
|
||||||
|
|
||||||
echo 'Test case 6' . PHP_EOL;
|
echo 'Test case 6' . PHP_EOL;
|
||||||
$connectionOptions = array('Encrypt' => 0);
|
$connectionOptions = array('Encrypt' => 0);
|
||||||
$conn = sqlsrv_connect($server, $connectionOptions);
|
$conn = sqlsrv_connect($server, $connectionOptions);
|
||||||
if ($conn === false) {
|
if ($conn != false) {
|
||||||
die(print_r(sqlsrv_errors(), true));
|
sqlsrv_close($conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo 'Test case 7' . PHP_EOL;
|
echo 'Test case 7' . PHP_EOL;
|
||||||
|
|
Loading…
Reference in a new issue