silverstripe / cwp-installer

CWP project template
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Something causes framework form field test failures #16

Closed NightJar closed 6 years ago

NightJar commented 6 years ago

To do with entity encoding of values being outputted by HTMLEditorField and TextareaField, the tests expect the contained unicode characters to be turned into entities, and indeed the tests pass in the framework suite's travis-ci builds, or whenever using a project built from e.g. silverstripe/installer.

SilverStripe\Forms\Tests\HTMLEditor\HTMLEditorFieldTest::testCasting
Failed asserting that 'These are some unicodes: ä, ö, & ü' contains "These are some unicodes: ä, ö, & ü".
SilverStripe\Forms\Tests\TextareaFieldTest::testCasting
Failed asserting that 'These are some unicodes: ä, ö, & ü' contains "These are some unicodes: ä, ö, & ü".

Particularly troubling is the fact that TextareaField appears to be escaping an ampersand correctly, where HTMLEditorField is not.

A first thought would think that this is caused by the silverstripe/html5 module, which alters the parser used in these fields. However testing with silverstripe/installer and requiring silverstripe/html5 into that project still sees all the tests pass. It must be another module (or combination there-of). Unfortunately there are approximately 56 pulled in via cwp/cwp-installer, so this was the most logical place to create the issue, for now. Once the problem is tracked down we can create an issue there and link the two.