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  
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.
This commit is contained in:
Andrew Nicols
2015-10-12 09:35:59 +08:00
parent ec2d33dfcd
commit 44250050dc
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -21,6 +21,8 @@ Thanks for helping with QA testing. Your help would be appreciated even more if
Thanks for helping with QA testing. It has been observed that you assigned this issue to yourself for testing, but no action has been taken on this. It will be helpful if you can either test this or un-assign yourself, so someone else can take it.
----EXPECTEDHTML----
 
Sample reply messages:
Thanks for offering to help with QA testing. I've added you to the testers
@@ -49,7 +51,7 @@ passed without being run.
Thanks for helping with QA testing. It has been observed that you assigned
this issue to yourself for testing, but no action has been taken on this.
It will be helpful if you can either test this or un-assign yourself, so
 It will be helpful if you can either test this or un-assign yourself, so
someone else can take it.
Sent from my iPad
@@ -332,4 +334,4 @@ mail.</p>
</div></blockquote></body></html>=
--Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F--
--Apple-Mail-97963C5D-72E2-413A-89FF-624233E4337F--
+2 -2
View File
@@ -13,9 +13,9 @@ Cheers
Rajesh
----EXPECTEDHTML----
Sending mail via clent and it seems to go all good...
Sending mail via clent and it seems to go all good...
Havent tried this before and it is awesome....
Havent tried this before and it is awesome....
Cheers
Rajesh
+1 -1
View File
@@ -94,7 +94,7 @@ class core_weblib_testcase extends advanced_testcase {
format_text_email('<p class="frogs">This is a <strong class=\'fishes\'>test</strong></p>', FORMAT_HTML));
$this->assertSame('& so is this',
format_text_email('&amp; so is this', FORMAT_HTML));
$this->assertSame('Two bullets: '.core_text::code2utf8(8226).' *',
$this->assertSame('Two bullets: ' . core_text::code2utf8(8226) . ' ' . core_text::code2utf8(8226),
format_text_email('Two bullets: &#x2022; &#8226;', FORMAT_HTML));
$this->assertSame(core_text::code2utf8(0x7fd2).core_text::code2utf8(0x7fd2),
format_text_email('&#x7fd2;&#x7FD2;', FORMAT_HTML));