Problem/Motivation
SimpleTest Example doesn't help anyone learn how to set up a mock module for functional testing.
The SimpleTest Tutorial doesn't either. It is located here: https://drupal.org/simpletest-tutorial-drupal7
Proposed resolution
Add a mock module to SimpleTest Example. (done)
Also, update the tutorial. (not yet done)
Remaining tasks
User interface changes
API changes
Original report by linclark
The SimpleTest example has all of the files directly under the simpletest directory. However, modules like node and rdf put the simpletest.info and simpletest.module files in a 'test' directory. It might be good to follow this convention in the example.
Comments
Comment #1
Anonymous (not verified) commentedActually, I realize now that the .info and .module file in there isn't a module for testing (modules that you use during the test to check install functionality, etc.), but a module that is having tests run on it.
You may want to consider making a more complex example that includes a module for testing, like node and rdf have, so I've changed the category to feature request. That might be outside the scope of the Examples project, though.
Comment #2
rfayActually, I think the simpletest example (and tutorial) need a mock module (one that's not visible on the modules page). This is a standard part of writing tests, and we don't even mention it in the tutorial.
Thanks!
Comment #3
tr commentedBumping and assigning a version. I think this is a good idea.
Comment #4
mile23Here's a mock module example patch.
It does very little, just implements hook_node_view() to add some content, and then tests for that content.
Comment #5
mile23Comment #6
mile23Code committed: http://drupalcode.org/project/examples.git/commitdiff/492002e2491569625b...
If someone wants to re-work the tutorial, that'd be great. I'll leave this issue open in hopes someone will feel moved to do so.
If you're inspired to re-work the code, however, add a new issue about it and link it to this one.
Comment #7
mile23Comment #8
mile23Comment #9
mile23So this is really fixed. If someone wants to add to it, just open a new issue. Thanks.
It's minimal maintenance time for the 7.x-1.x branch of Examples. See #2642596: D6, D7 Roadmap for Examples