Skip to content

Commit 22dad61

Browse files
authored
Update locale test (#1490)
1 parent 6dc897a commit 22dad61

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/functional/pdo_sqlsrv/pdo_1063_test_locale.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ function printMoney($amt, $info)
2525
echo PHP_EOL;
2626
}
2727

28-
function printCal($date)
28+
function printCal($date, $locale)
2929
{
3030
$loc = setlocale(LC_TIME, 0);
31+
if ($loc === "C") {
32+
$loc = $locale;
33+
}
3134
$fmt = datefmt_create(
3235
$loc,
3336
IntlDateFormatter::FULL,
@@ -111,7 +114,7 @@ function printCal($date)
111114
printMoney($n1, $info);
112115

113116
$d = new DateTime("12/25/2020", new DateTimeZone('America/Los_Angeles'));
114-
printCal($d);
117+
printCal($d, $locale);
115118

116119
try {
117120
$conn = new PDO("sqlsrv:server = $server; database=$databaseName; driver=$driver", $uid, $pwd );

test/functional/sqlsrv/srv_1063_test_locale.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ function printMoney($amt, $info)
3030
}
3131
}
3232

33-
function printCal($date)
33+
function printCal($date, $locale)
3434
{
3535
$loc = setlocale(LC_TIME, 0);
36+
if ($loc === "C") {
37+
$loc = $locale;
38+
}
3639
$fmt = datefmt_create(
3740
$loc,
3841
IntlDateFormatter::FULL,
@@ -117,7 +120,7 @@ function printCal($date)
117120
printMoney($n1, $info);
118121

119122
$d = new DateTime("12/25/2020", new DateTimeZone('America/Los_Angeles'));
120-
printCal($d);
123+
printCal($d, $locale);
121124

122125
$conn = sqlsrv_connect($server, $connectionOptions);
123126
if (!$conn) {

0 commit comments

Comments
 (0)