Skip to content

Commit

Permalink
Modified some BVT tests to be configurable (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam authored Mar 16, 2020
1 parent 8bb6cef commit fb335c0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ install:
}
- echo Downloading MSODBCSQL 17
# AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/msodbcsql_17.4.2.1_x64.msi', 'c:\projects\msodbcsql_17.4.2.1_x64.msi')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql_17.4.2.1_x64.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/E/6/B/E6BFDC7A-5BCD-4C51-9912-635646DA801E/en-US/17.5.2.1/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi')
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL
- echo Checking the version of MSODBCSQL
- reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 17 for SQL Server"
- dir %WINDIR%\System32\msodbcsql*.dll
Expand Down
15 changes: 9 additions & 6 deletions test/bvt/sqlsrv/break.inc
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?php

require_once('connect.inc');

// Set SQL server + user + password
$serverName = getenv('MSSQL_SERVERNAME') ?: "sql-2k14-sp2-1.galaxy.ad";
$username = getenv('MSSQL_USERNAME') ?: "sa";
$password = getenv('MSSQL_PASSWORD') ?: "Moonshine4me";
$serverName = getenv('MSSQL_SERVERNAME') ?: $server2;
$username = getenv('MSSQL_USERNAME') ?: $uid;
$password = getenv('MSSQL_PASSWORD') ?: $pwd;

// Generate unique DB name, example: php_20160817_1471475608267
$databaseName = "php_" . date("Ymd") . "_" . round(microtime(true)*1000);

// Generic table name example: php_20160817_1471475608267.dbo.php_firefly
$tableName1 = $databaseName.".dbo.php_firefly1";
$tableName2 = $databaseName.".dbo.php_firefly2";
// Generic table name example: php_20160817_1471475608267.dbo.php_table
$tableName1 = $databaseName.".dbo.php_table1";
$tableName2 = $databaseName.".dbo.php_table2";

$connectionInfo = array( "Database"=>"$databaseName", "username"=>"$username", "password"=>"$password" );
$conn = sqlsrv_connect( $serverName, $connectionInfo );
Expand Down
2 changes: 2 additions & 0 deletions test/bvt/sqlsrv/connect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $databaseName = 'TARGET_DATABASE';
$uid = 'TARGET_USERNAME';
$pwd = 'TARGET_PASSWORD';

$server2 = 'ANOTHER_SERVER';

// RevisionNumber in SalesOrderHeader is subject to a trigger incrementing it whenever
// changes are made to SalesOrderDetail. Since RevisionNumber is a tinyint, it can
// overflow quickly if the BVT tests often run. So we change it directly here first
Expand Down
5 changes: 3 additions & 2 deletions test/bvt/sqlsrv/msdn_sqlsrv_connect_MARS.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ $conn = sqlsrv_connect( $server, $connectionInfo);

/* Connect to the local server using Windows Authentication and
specify the AdventureWorks database as the database in use. */
$serverName = "sql-2k14-sp1-1.galaxy.ad";
$connectionInfo = array( "Database"=>"AdventureWorks2014", "UID"=>"sa", "PWD"=>"Moonshine4me", 'MultipleActiveResultSets'=> false);
$serverName = $server2;
$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd, 'MultipleActiveResultSets'=> false);

$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
Expand Down
4 changes: 2 additions & 2 deletions test/bvt/sqlsrv/msdn_sqlsrv_get_field_stream_binary.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/* Connect to the local server using Windows Authentication and
specify the AdventureWorks database as the database in use. */
$serverName = "sql-2k14-sp1-1.galaxy.ad";
$connectionInfo = array( "Database"=>"AdventureWorks2014", "UID"=>"sa", "PWD"=>"Moonshine4me");
$serverName = $server2;
$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
Expand Down
5 changes: 1 addition & 4 deletions test/bvt/sqlsrv/msdn_sqlsrv_query_scrollable.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ server side cursor specified when querying

--FILE--
<?php
//$server = "sql-2k14-sp1-1.galaxy.ad";
//$conn = sqlsrv_connect( $server, array( "Database" => "tempdb", "UID"=>"sa", "PWD"=>"Moonshine4me"));

require('connect.inc');
$connectionInfo = array( "Database"=>"$databaseName", "UID"=>"$uid", "PWD"=>"$pwd");
$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd);
$conn = sqlsrv_connect( $server, $connectionInfo);
if ( $conn === false ) {
die( print_r( sqlsrv_errors(), true ));
Expand Down

0 comments on commit fb335c0

Please sign in to comment.