Problem/Motivation
WebTestBase depends on Node module and Comment module. See WebTestBase::drupalCreateNode() for the proof. (For Comment module it's actually enough for comment.module to be loaded, but still...). It does not explicitly declare those dependencies, though.
To reproduce this, you must be running tests with Comment module disabled (on the parent site), and then run a test which calls drupalCreateNode() and doesn't declare comment.module as a dependency. (I didn't explore this in excessively, but that's how I ran into it.)
Proposed resolution
The "stopgap" fix would be for SimpleTest to declare node and comment module as a dependency. Since this is apparently not something that appears often, that's probably not necessary, though.
It would make more sense to actually decouple WebTestBase from Node and Comment module, though. From the top of my head, a couple of options:
1. Turn drupalCreateNode() and friends into static methods. That would require passing in a bit more stuff, but would be possible, I guess.
2. Drop drupalCreateNode() and just let people use entity_create() and $node->save().
3. Move the node/comment-specific stuff into a separate base class.
Remaining tasks
Discuss.
User interface changes
None.
API changes
We'll see.
Comment | File | Size | Author |
---|---|---|---|
#1 | foo.patch | 667 bytes | tstoeckler |
Comments
Comment #1
tstoecklerThis would be "stopgap" fix I meant. Again, not really proposing we actually commit this, but...
Comment #2
tim.plunkett#1812732: Use constants instead of integers in drupalCreateNode() and improve its documentation was re-opened to fix this.
Comment #3
larowlanRelated #731724: Convert comment settings into a field to make them work with CMI and non-node entities