[TASK] Add getArrayRepresentation() to Renderable - #1447
Conversation
This method will make it easier to test the parsing independently of the rendering. Placeholder implementations are currently all stubs that will throw an exception, confirmed by tests. They can be implemented as and when required, with the tests updated. Part of #1440.
There was a problem hiding this comment.
We also should have the stub implementation (plus tests) in the concrete subclasses of the (usually) abstract classes as the real implementations usually will be different for each class:
CSSList:KeyFrameCSSBlockList:AtRuleBlockListDocument
AtRuleBlockList
ValueList:CSSFunctionCalcFunctionColorLineNameRuleValueListCalcRuleValueList
PrimitiveValue:CSSStringURLSize
Selector:KeyframeSelector
(I hope I haven't missed any class.)
|
I'd also be fine with doing that in a follow-up PR. |
oliverklee
left a comment
There was a problem hiding this comment.
Ah, well, let's merge this and add the methods to the subclasses in a separate PR:
I'm not sure that's necessary. We can just add the real implementations as and when they are needed. If a child class ends up inheriting a parent implementation, but should have a different implementation (probably extended with additional properties), it will be obvious when we come to use it in testing that the child class method needs to be implemented (and tested) first, since it will not return (all) the properties we want to check. |
This method will make it easier to test the parsing independently of the rendering.
Placeholder implementations are currently all stubs that will throw an exception, confirmed by tests.
They can be implemented as and when required, with the tests updated.
Part of #1440.