Skip to content

Commit

Permalink
Fixed sqlsrv test again
Browse files Browse the repository at this point in the history
  • Loading branch information
yitam committed Dec 19, 2019
1 parent 0b3f113 commit 3785e14
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/functional/sqlsrv/srv_1063_test_locale.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
<?php

function dropTable($conn, $tableName)
{
$tsql = "IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'" . $tableName . "') AND type in (N'U')) DROP TABLE $tableName";
sqlsrv_query($conn, $tsql);
}

function fatalError($message)
{
var_dump(sqlsrv_errors(SQLSRV_ERR_ALL));
die($message);
}

// This test is invoked by srv_1063_locale_configs.phpt
require_once('MsCommon.inc');
require_once('MsSetup.inc');

$locale = ($_SERVER['argv'][1] ?? '');

Expand All @@ -23,7 +35,10 @@
echo strftime("%A", strtotime("12/25/2020")) . PHP_EOL;
echo strftime("%B", strtotime("12/25/2020")) . PHP_EOL;

$conn = connect();
$conn = sqlsrv_connect($server, $connectionOptions);
if (!$conn) {
fatalError("Failed to connect to $server.");
}

$tableName = "[" . "srv1063" . $locale . "]";
dropTable($conn, $tableName);
Expand Down

0 comments on commit 3785e14

Please sign in to comment.