Add assertions for ignoring whitespace differences in strings #5757
Labels
feature/assertion
Issues related to assertions and expectations
type/enhancement
A new idea that should be implemented
ICU 72.1 replaced an ASCII space with a Unicode Narrow-Non-Breaking-Space.
In our codebase we have some code which works with \DateTime to produce dates in various formats and we confirm that the output is correct.
With the changes in ICU 72.1 out tests break because the visually identical space is different.
It would not be correct to update the string in the test because it is dependent upon the version of ICU installed on the test system.
PHPUnit already has assertions for things like
assertEqualsIgnorningCase
,assertStringContainsStringIgnoringCase
, andassertEqualsCanonicalizing
.I wonder whether there is some merit in creatinng an assertion for
assertEqualsIgnoringWhitespace
which would essentially add:The text was updated successfully, but these errors were encountered: