[4.x] Create RichContentFaker class
Description
Adds a RichContentFaker class to allow for easier population of rich editor content in factories and tests.
Functional changes
- [x] Code style has been fixed by running the
composer cscommand. - [x] Changes have been tested to not break existing functionality.
- [x] Documentation is up-to-date.
Do you want it tested against the renderer output or the content in the editor in the browser?
Not sure what you mean? Tested against the output of the PHP function, no need for a browser test
Maybe I'm just not clear on what you mean by "snapshot" test.
I'm my mind snapshot implies browser. But as long as the RichContentRender outputs the correct html or json/array I think that satisfies the test.
Am I wrong?
It's not a screenshot, it stores text: https://pestphp.com/docs/snapshot-testing
I'm not sure snapshot testing is going to work with this since each time the faker is called it would be different text, like in paragraphs which are using the $faker->paragraphs().
Wouldn't that cause the snapshot to fail every time?