PHPUnit 9.5.8 by Sebastian Bergmann and contributors.
. 1 / 1 (100%)
Time: 00:00.310, Memory: 28.00 MB
OK (1 test, 1 assertion)
This is the output with CollectErrors Off:
1) VtlibUtilsTest::testvtlib_purify with data set #0 ('xf2n*7&#&Qm&JU2', false, 'xf2n*7&#&Qm&JU2', 'special &#&')
testvtlib_purify special &#&
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'xf2n*7&#&Qm&JU2'
+'xf2n*7&Qm&JU2'
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
CollectErrors changes the lexer from DOMLex (DOMDocument) to DirectLex so that's why there's a difference. xf2n*7&#&Qm&JU2 isn't valid HTML though, &#& is an incomplete entity.
If you use this input: 'xf2n*7&#&Qm&JU2', the ecoding will be incorrect if the 'CollectErrors' are No. The '#' within '&' will be lost.
This occurred in version 4.13 and 4.15. The workaround is to turn on CollectErrors. This is the Test Unit.
This is the output with CollectErrors On :
This is the output with CollectErrors Off: