Both #360023: Update node_comment_statistics during "Publish comment" action and #306611: Fatal error when trying to invoke non-existing action callbacks were unnecessarily hold off, because we don't have any tests for actions yet.
AFAICS, actions can be invoked directly or via Trigger module. Trigger module ships with a few tests for its own functionality.
Actions can be directly invoked via actions_do(), and it seems like
- a single system action can be invoked directly, either providing the target object directly or some $context that only contains an object id
- multiple system actions can be invoked directly, ditto.
- configurable actions can be invoked, ditto.
We have an actions.test file in modules/simpletest/tests, but that is testing configuration of actions only.
In general, we have too few actions. And we have too few triggers (f.e. comment_insert, but no comment_publish), but that's off-topic.
The first of all questions is where we want to put tests for actions. Logical would be to have each module's .test file test its own actions. However, it's possible that such tests require some common helper functions to run tests for the implemented actions. I.e., it boils down to specifying the available actions, their "context" (node, comment, ...), and the expected result (potentially using a helper method).
Comments
Comment #1
sunComment #2
jhodgdonNote that some tests for actions were added in #525540: trigger.module and includes/actions.inc need overhaul recently.
Comment #3
catch#653074: Review test coverage / outstanding tests before release
Comment #4
webchickCould someone update this issue with what tests from above are remaining to implement? Depending on how wide of a swath is missing, it might make sense to bump this back to critical in its own right.
Comment #5
andypostAll cases already covered by tests except #721086: Create tests for system actions, clean up token replacement, clean up triggers
Comment #6
webchickOk cool. Let's mark this sucker fixed then. Thanks!