MDL-51524 tests: Fix broken tests
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 9 Oct 2015 05:03:33 +0000 (13:03 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 12 Oct 2015 01:35:59 +0000 (09:35 +0800)
commit44250050dc2ce337262e05bb01b31dc19115122a
treebd0359dd28e58efa1021b6e58ab1d8b679f2b8d5
parentec2d33dfcd32f2dc73466176b97775d1f75314bb
MDL-51524 tests: Fix broken tests

The upgraded version of HTML2Text highlighted some bugs in our unit tests.

In the IOS test, the HTML content includes a couple of patches of &nbsp;
In the previous version of HTML2Text, these were being converted to
breaking spaces. In one of these cases, it was then removed due to a trim.
The expected texts have been converted to use the correct non-breaking spaces.
In the case of the trimmed one, it is no longer trimmed as non-breaking
spaces are not trimmed.
This gives a truer reflection of the actual text.

In the case of the Outlook test, this trailing whitespace is not present in
the source. It was likely caused by a bug in the previous version of
HTML2Text.

In the case of the weblib change, the test was just wrong. Both of the
actual characters are encodings for an HTML bullet (decimal and hex) and
should both be converted to the relevant UTF8 representation of this
bullet.
lib/tests/fixtures/messageinbound/ios.test
lib/tests/fixtures/messageinbound/outlook.test
lib/tests/weblib_test.php