modified sqlsrv test

This commit is contained in:
yitam 2017-05-08 08:57:30 -07:00
parent 9e8cb88ca7
commit 75ee4f90ad
2 changed files with 15 additions and 3 deletions

View file

@ -1217,7 +1217,7 @@ int get_conn_option_key( sqlsrv_context& ctx, zend_string* key, size_t key_len,
}
bool valid = true;
if( stricmp( SS_CONN_OPTS[i].sqlsrv_name, ODBCConnOptions::Authentication ) == 0 ) {
if( stricmp( SS_CONN_OPTS[i].sqlsrv_name, SSConnOptionNames::Authentication ) == 0 ) {
valid = core_is_authentication_option_valid( value, value_len );
}

View file

@ -6,8 +6,19 @@ Test the Authentication keyword and its accepted values: SqlPassword and ActiveD
<?php
require_once("autonomous_setup.php");
$connectionInfo = array( "UID"=>$username, "PWD"=>$password );
$conn = sqlsrv_connect( $serverName, $connectionInfo );
if( $conn === false )
{
echo "Failed to connect!\n";
print_r( sqlsrv_errors() );
die();
}
////////////////////////////////////////
$connectionInfo = array( "UID"=>$username, "PWD"=>$password,
"Authentication"=>'SqlPassword', "TrustServerCertificate"=>true );
"Authentication"=>"SqlPassword", "TrustServerCertificate"=>true );
$conn = sqlsrv_connect( $serverName, $connectionInfo );
if( $conn === false )
@ -31,11 +42,12 @@ else
var_dump( $first_db );
}
sqlsrv_free_stmt( $stmt );
sqlsrv_close( $conn );
////////////////////////////////////////
$connectionInfo = array( "Authentication"=>'ActiveDirectoryIntegrated', "TrustServerCertificate"=>true );
$connectionInfo = array( "Authentication"=>"ActiveDirectoryIntegrated", "TrustServerCertificate"=>true );
$conn = sqlsrv_connect( $serverName, $connectionInfo );
if( $conn === false )