Skip to content

Commit 61c686f

Browse files
authored
Unit test fixes (#1455)
* Add driver, modify expect result * Update pdo_construct.phpt Timeout too early the driver won't get the expected error. * Update pdo_construct_conn_options.phpt * Turn off trace due to UnixODBC bug
1 parent c648caf commit 61c686f

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

test/functional/pdo_sqlsrv/pdo_1261_test_ascii_utf8.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ try {
1515
ini_set('pdo_sqlsrv.log_severity', '2');
1616
ini_set('error_log', $logFilepath);
1717

18-
$conn = new PDO("sqlsrv:Server=$server;Database=$databaseName;", $uid, $pwd);
18+
$conn = new PDO("sqlsrv:Server=$server;Database=$databaseName;driver=$driver;", $uid, $pwd);
1919
$conn->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_SYSTEM);
2020
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
2121

@@ -50,8 +50,8 @@ array(1) {
5050
}
5151
[%s] pdo_sqlsrv_db_handle_factory: SQLSTATE = 01000
5252
[%s] pdo_sqlsrv_db_handle_factory: error code = 5701
53-
[%s] pdo_sqlsrv_db_handle_factory: message = [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Changed database context to '%s'.
53+
[%s] pdo_sqlsrv_db_handle_factory: message = [Microsoft][ODBC Driver %s for SQL Server][SQL Server]Changed database context to '%s'.
5454
[%s] pdo_sqlsrv_db_handle_factory: SQLSTATE = 01000
5555
[%s] pdo_sqlsrv_db_handle_factory: error code = 5703
56-
[%s] pdo_sqlsrv_db_handle_factory: message = [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Changed language setting to %s.
56+
[%s] pdo_sqlsrv_db_handle_factory: message = [Microsoft][ODBC Driver %s for SQL Server][SQL Server]Changed language setting to %s.
5757

test/functional/pdo_sqlsrv/pdo_construct.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,12 @@ try {
2424

2525
$dsn = "ConnectionPooling = false;" .
2626
"APP = whatever;" .
27-
"LoginTimeout = 1;" .
2827
"ApplicationIntent = ReadOnly;" .
2928
"Encrypt = false;" .
3029
"Failover_Partner = whatever;" .
3130
"MultipleActiveResultSets = true;" .
3231
"MultiSubnetFailover = NO;" .
3332
"QuotedId = false;" .
34-
"TraceFile = whatever;" .
35-
"TraceOn = true;" .
3633
"TransactionIsolation = " . PDO::SQLSRV_TXN_READ_UNCOMMITTED . ";" .
3734
"TrustServerCertificate = false;" .
3835
"WSID = whatever;";
@@ -53,4 +50,4 @@ array(3) {
5350
[2]=>
5451
string(58) "An unsupported attribute was designated on the PDO object."
5552
}
56-
Test Successful
53+
Test Successful

test/functional/pdo_sqlsrv/pdo_construct_conn_options.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ require_once("MsCommon_mid-refactor.inc");
1010
try {
1111
$dsn = "ConnectionPooling = false;" .
1212
"APP = whatever;" .
13-
"LoginTimeout = 1;" .
1413
"ApplicationIntent = ReadOnly;" .
1514
"Encrypt = false;" .
1615
"Failover_Partner = whatever;" .
1716
"MultipleActiveResultSets = true;" .
1817
"MultiSubnetFailover = NO;" .
1918
"QuotedId = false;" .
20-
"TraceFile = whatever;" .
21-
"TraceOn = true;" .
2219
"TrustServerCertificate = false;" .
2320
"WSID = whatever;";
2421
$conn = connect($dsn);

test/functional/sqlsrv/sqlsrv_testConnection_unix.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ if ((strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN')) {
7373
"LoginTimeout" => 120,
7474
"MultipleActiveResultSets" => false,
7575
"QuotedId" => false,
76-
"TraceOn" => true,
77-
"TraceFile" => "trace.odbc",
7876
"TransactionIsolation" => SQLSRV_TXN_READ_COMMITTED,
7977
"TrustServerCertificate" => 1,
8078
"WSID" => "JAYKINT1" );
@@ -85,8 +83,6 @@ if ((strtoupper(substr(php_uname('s'), 0, 3)) === 'WIN')) {
8583
"LoginTimeout" => 120,
8684
"MultipleActiveResultSets" => false,
8785
"QuotedId" => true,
88-
"TraceOn" => true,
89-
"TraceFile" => "trace.odbc",
9086
"TransactionIsolation" => SQLSRV_TXN_READ_COMMITTED,
9187
"TrustServerCertificate" => 1,
9288
"WSID" => "JAYKINT1" );

0 commit comments

Comments
 (0)