Skip to content

Commit 46b1edb

Browse files
CDRfabpot
authored andcommitted
[VarDumper] Test intl formatter broken since dumper does not replace the nnbsp character by standard space
1 parent 1c87e55 commit 46b1edb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/VarDumper/Tests/Caster/IntlCasterTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function testCastDateFormatter()
234234
$var = new \IntlDateFormatter('en', \IntlDateFormatter::TRADITIONAL, \IntlDateFormatter::TRADITIONAL);
235235

236236
$expectedLocale = $var->getLocale();
237-
$expectedPattern = $var->getPattern();
237+
$expectedPattern = $this->normalizeNarrowNoBreakSpaceCharacter($var->getPattern());
238238
$expectedCalendar = $var->getCalendar();
239239
$expectedTimeZoneId = $var->getTimeZoneId();
240240
$expectedTimeType = $var->getTimeType();
@@ -294,4 +294,9 @@ public function testCastDateFormatter()
294294
EOTXT;
295295
$this->assertDumpEquals($expected, $var);
296296
}
297+
298+
private function normalizeNarrowNoBreakSpaceCharacter(string $input): string
299+
{
300+
return str_replace("\u{202F}", '\\u{202F}', $input);
301+
}
297302
}

0 commit comments

Comments
 (0)