GHOP #164 Create tests for comment module
| Project: | SimpleTest |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
* Set up comments without a subject. Check that the subject field is not there.
* Set up comments to have a subject. Preview, submit, reply, edit, delete a comment. Check the reply is gone too.
* Set Preview comment to required. check that it is indeed required.
* Check both locations of the comment submission form work: the form and submissions works.
* Check all three options of anonymous commenting: leave comments with or without contact information as appropriate
* Check admin/content/comment and admin/content/comment/approval for correctness: publish / unpublish / delete a comment. Post a comment with a user that has no "post comments without approval" only "post comments" and check the comment is not visible for other users. Approve it and see it is.

#1
I believe this beast is working.
#2
#3
- // $Id: should be // $Id$
- Your test needs a description more descriptive than "..." :)
- No need to override tearDown if you're not actually performing tearDown tasks.
- Instead of set_comment_settings business, I'd just do a plain $this->variableSet(); for those form values. This has the advantage of cleaning up after your test so you don't permanently alter the state of the database.
- Let's get some Doxygen comments on those functions, hmm? ;)
- I wonder if these should be broken up a little into different test* functions, rather than all chunked under testComment. That's a /long/ function. Is there a nice place to split up the functionality? (ex: testEdit, testAnonymous, testDelete, test...)
Sorry, I'm too tired to do a more thorough functionality review, atm. Will leave to chx/Zlender.
#4
Summary:
Thanks for reviewing it.
#5
Marking back for review.
#6
I believe I successfully split up tasks.
#7
Tests looks great. I went over the code and couldn't find any problems. Tomorrow I'll try running the test and will commit afterwards. This is amazing test thanks boombatower.
#8
Committed to D6 branch now testing for head.
#9
Committed to HEAD.
#10
Automatically closed -- issue fixed for two weeks with no activity.