modified tests for Azure testing
This commit is contained in:
parent
d238411a80
commit
e535e85d1f
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
include 'MsSetup.inc';
|
||||
$conn1 = new PDO("sqlsrv:Server=$server", $uid, $pwd);
|
||||
$conn1 = new PDO("sqlsrv:Server=$server; database=$databaseName", $uid, $pwd);
|
||||
$connId1 = ConnectionID($conn1);
|
||||
$conn1 = null;
|
||||
|
||||
$conn2 = new PDO("sqlsrv:Server=$server", $uid, $pwd);
|
||||
$conn2 = new PDO("sqlsrv:Server=$server; database=$databaseName", $uid, $pwd);
|
||||
$connId2 = ConnectionID($conn2);
|
||||
$conn2 = null;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ require 'MsSetup.inc';
|
|||
|
||||
try{
|
||||
// Test 1
|
||||
$conn = new PDO( "sqlsrv:Server=$server;Database=$databaseName;ConnectionPooling=false;" , "test_password", "! ;4triou");
|
||||
$conn = new PDO( "sqlsrv:Server=$server;ConnectionPooling=false;" , "test_password", "! ;4triou");
|
||||
if(!$conn)
|
||||
{
|
||||
echo "Test 1: Should have connected.";
|
||||
|
@ -26,7 +26,7 @@ catch(PDOException $e){
|
|||
}
|
||||
try{
|
||||
// Test 2
|
||||
$conn = new PDO( "sqlsrv:Server=$server;Database=$databaseName;ConnectionPooling=false;" , "test_password2", "!}} ;4triou");
|
||||
$conn = new PDO( "sqlsrv:Server=$server;ConnectionPooling=false;" , "test_password2", "!}} ;4triou");
|
||||
if(!$conn)
|
||||
{
|
||||
echo "Test 2: Should have connected.";
|
||||
|
@ -38,7 +38,7 @@ catch(PDOException $e){
|
|||
}
|
||||
try{
|
||||
// Test 3
|
||||
$conn = new PDO( "sqlsrv:Server=$server;Database=$databaseName;ConnectionPooling=false;" , "test_password3", "! ;4triou}}");
|
||||
$conn = new PDO( "sqlsrv:Server=$server;ConnectionPooling=false;" , "test_password3", "! ;4triou}}");
|
||||
if(!$conn)
|
||||
{
|
||||
echo "Test 3: Should have connected.";
|
||||
|
@ -52,7 +52,7 @@ catch(PDOException $e){
|
|||
try
|
||||
{
|
||||
// Test 4
|
||||
$conn = new PDO( "sqlsrv:Server=$server;Database=$databaseName;ConnectionPooling=false;" , "test_password3", "! ;4triou}");
|
||||
$conn = new PDO( "sqlsrv:Server=$server;ConnectionPooling=false;" , "test_password3", "! ;4triou}");
|
||||
}
|
||||
catch( PDOException $e ) {
|
||||
print_r( $e->getMessage() );
|
||||
|
|
|
@ -4,7 +4,7 @@ if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
|||
|
||||
include 'MsCommon.inc';
|
||||
if ( IsDaasMode() ) {
|
||||
die("skip test in Azure");
|
||||
die("test not applicable in Azure");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -6,7 +6,7 @@ if (!extension_loaded("sqlsrv")) {
|
|||
|
||||
include 'MsCommon.inc';
|
||||
if ( IsDaasMode() ) {
|
||||
die("skip test in Azure");
|
||||
die("test not applicable in Azure");
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,7 +1,13 @@
|
|||
--TEST--
|
||||
variety of connection parameters.
|
||||
--SKIPIF--
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
<?php
|
||||
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." );
|
||||
if ( ! extension_loaded("sqlsrv")) die( "skip extension not loaded" );
|
||||
|
||||
include 'MsCommon.inc';
|
||||
if ( IsDaasMode() ) die("skip test not applicable in Azure");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ Test MultipleActiveResultSets connection setting off
|
|||
|
||||
require( 'MsCommon.inc' );
|
||||
|
||||
$conn = ConnectSpecial(array( 'MultipleActiveResultSets' => false ));
|
||||
$conn = Connect(array( 'MultipleActiveResultSets' => false ));
|
||||
if( $conn === false ) {
|
||||
die( print_r( sqlsrv_errors(), true ));
|
||||
}
|
||||
|
|
|
@ -12,9 +12,20 @@ to the test database defined in MsSetup.inc
|
|||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
|
||||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL );
|
||||
|
||||
require( 'MsCommon.inc' );
|
||||
function toConnect($options = array())
|
||||
{
|
||||
require 'MsSetup.inc';
|
||||
|
||||
if (!isset($options['UID']) && !isset($options['uid'])) {
|
||||
$options['UID'] = $uid;
|
||||
}
|
||||
if (!isset($options['pwd']) && !isset($options['PWD'])) {
|
||||
$options['pwd'] = $pwd;
|
||||
}
|
||||
return sqlsrv_connect($server, $options);
|
||||
}
|
||||
|
||||
$conn = ConnectSpecial(array( "UID" => "test_password", "pwd" => "! ;4triou" ));
|
||||
$conn = toConnect(array( "UID" => "test_password", "pwd" => "! ;4triou" ));
|
||||
if (!$conn)
|
||||
{
|
||||
$errors = sqlsrv_errors();
|
||||
|
@ -22,7 +33,7 @@ if (!$conn)
|
|||
}
|
||||
sqlsrv_close( $conn );
|
||||
|
||||
$conn = ConnectSpecial(array( "UID" => "test_password2", "pwd" => "!}} ;4triou" ));
|
||||
$conn = toConnect(array( "UID" => "test_password2", "pwd" => "!}} ;4triou" ));
|
||||
if (!$conn)
|
||||
{
|
||||
$errors = sqlsrv_errors();
|
||||
|
@ -30,7 +41,7 @@ if (!$conn)
|
|||
}
|
||||
sqlsrv_close( $conn );
|
||||
|
||||
$conn = ConnectSpecial(array( "UID" => "test_password3", "pwd" => "! ;4triou}}" ));
|
||||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}}" ));
|
||||
if (!$conn)
|
||||
{
|
||||
$errors = sqlsrv_errors();
|
||||
|
@ -38,7 +49,7 @@ if (!$conn)
|
|||
}
|
||||
sqlsrv_close( $conn );
|
||||
|
||||
$conn = ConnectSpecial(array( "UID" => "test_password3", "pwd" => "! ;4triou}" ));
|
||||
$conn = toConnect(array( "UID" => "test_password3", "pwd" => "! ;4triou}" ));
|
||||
if ($conn)
|
||||
{
|
||||
echo( "Shouldn't have connected" );
|
||||
|
@ -51,5 +62,5 @@ print "Test successful";
|
|||
?>
|
||||
--EXPECTREGEX--
|
||||
An unescaped right brace \(}\) was found in either the user name or password. All right braces must be escaped with another right brace \(}}\)\.
|
||||
Warning: sqlsrv_close\(\) expects parameter 1 to be resource, boolean given in .+(\/|\\)test_non_alpha_password\.php on line 38
|
||||
Warning: sqlsrv_close\(\) expects parameter 1 to be resource, boolean given in .+(\/|\\)test_non_alpha_password\.php on line 49
|
||||
Test successful
|
||||
|
|
Loading…
Reference in a new issue