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.

CommentFileSizeAuthor
#1 foo.patch667 byteststoeckler
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

FileSize
667 bytes

This would be "stopgap" fix I meant. Again, not really proposing we actually commit this, but...

tim.plunkett’s picture

Status: Active » Closed (duplicate)
larowlan’s picture