Skip to content

Commit ed0d10c

Browse files
committed
Tests_Formatting_ConvertInvalidEntities: add extra test cases
... to actually test the method properly.
1 parent 1859854 commit ed0d10c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/phpunit/tests/formatting/ConvertInvalidEntries.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,31 @@ public function test_convert_invalid_entities( $input, $expected ) {
2424
*/
2525
public function data_convert_invalid_entities_strings() {
2626
return array(
27+
'empty string' => array(
28+
'input' => '',
29+
'expected' => '',
30+
),
2731
'replaces windows1252 entities with unicode ones' => array(
2832
'input' => '‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ',
2933
'expected' => '‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ',
3034
),
3135
// @ticket 20503
32-
'replaces latin letter z with caron' => array(
36+
'replaces latin letter z with caron' => array(
3337
'input' => 'Žž',
3438
'expected' => 'Žž',
3539
),
40+
'string without entity is returned unchanged' => array(
41+
'input' => 'Hello! This is just text.',
42+
'expected' => 'Hello! This is just text.',
43+
),
44+
'string with unlisted entity is returned unchanged' => array(
45+
'input' => 'English pound: £.',
46+
'expected' => 'English pound: £.',
47+
),
48+
'string with entity in thousand range (not win 1252) is returned unchanged' => array(
49+
'input' => 'Їԣ',
50+
'expected' => 'Їԣ',
51+
),
3652
);
3753
}
3854

0 commit comments

Comments
 (0)