This is a child of a meta issue #2344799: [Meta issue] Clear _toString is not implemented errors.
This is causing a lint error
Method __toString is not implemented for the following objects.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | toString-2344823-6.patch | 1.43 KB | martin107 |
Comments
Comment #1
tstoecklerSo, it seems
editorXssFilterClassis a pretty poor variable name if it in fact does not contain a class?!Comment #3
martin107 commentedOk so that taught me a lesson!!! Here is plan B
We have a variable defined in setup() to be a string constant and read in ONLY one place to where it is concatenated with another string constant!!!!!
This should conventually be reduced to just one in-line string constant.
But I am reading the intent of the original developer.. and seeing that the way of doing things is primed for extension.
So I am just refining the poorly name variable and clearing the lint error.
editorXssFilterClass becomes filterUnderTest
and I've added some annotations so the next programmer can see at a glance the intent..
Comment #4
martin107 commentedComment #5
wim leersThanks!
This is indeed odd. It's because I copy/pasted bits of code from
editor_filter_xss(), which uses that same variable name.However, in this test, which tests only
\Drupal\editor\EditorXssFilter\Standard, we should just hardcode\Drupal\editor\EditorXssFilter\Standardand remove the variable altogether.Comment #6
martin107 commentedSimplifled.
Comment #7
martin107 commentedComment #8
wim leersThanks!
Comment #9
wim leersComment #10
webchickCommitted and pushed to 8.x. Thanks!