I have a unit test where I am trying to test the output of NumberFormatter
.
A simplified version of my code is:
public function testGetFormattedPrice()
{
$formatter = NumberFormatter::create(
"de_DE",
NumbererFormatter::CURRENCY
);
$this->assertEquals(
'16,66 €',
$formatter->formatCurrency(16.66, "EUR")
);
}
This results in a failure:
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'16,66 €'
+'16,66 €'
I am assuming this is related to the Euro symbol (maybe character encoding) or some sort of hidden bytes in the string, but not really sure how to check this?
Can anyone give me some advice on how to debug this issue, or what might be the possible cause?
Cheers,
Mo