gcode-mirror / google-highly-open-participation-drupal

Automatically exported from code.google.com/p/google-highly-open-participation-drupal
0 stars 0 forks source link

Write Simpletest tests for the Forum module #122

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Forum module is a popular feature for community sites. However, it's
not enabled by default and often new code is not checked to insure that it
does not break some part of this functionality.

The Simpletest module provides a framework for running automated unit tests
in Drupal. Unit testing involves taking a small portion of code, a unit,
and subjecting it to programmatic tests to prove its correctness. This can
be extremely useful to help insure that new code does not introduce bugs
into existing functionality. Thus, having a full suite of unit tests for
Drupal 6.x core functionality using the Simpletest module would be a major
step forward for the project and would help insure that only high-quality
code is committed. In addition to helping developers test their code, new
tests for core Drupal functionality will be used for automated testing by
http://testing.drupal.org.

For this task, you need to first install and familiarize yourself with the
simpletest module (use the cvs HEAD version with Drupal HEAD/6.x Beta):
http://drupal.org/project/simpletest
http://drupal.org/simpletest
http://www.lullabot.com/articles/introduction-unit-testing

The main work for this task is to write a small suite of tests to check the
basic functionality of the Forum module. This suite should be written as
a single .test file and should achieve RTBC status in the Simpletest module
issue queue. Post files/patches to this issue: http://drupal.org/node/203896

Suggested tests:

1. admin/content/forum/add/container Add a forum container.
2. admin/content/forum/add/forum Add a forum.
3. admin/content/taxonomy/edit/vocabulary/# Edit the forum vocabulary.
4. node/add/forum Create a new forum topic.
5. node/add/forum Attempt to add a forum topic to a container, rather than
a forum (this should not work).
6. node/#/edit Move a forum topic from one forum to another.
7. node/#/edit Move a forum topic from one forum to another, leaving a
shadow copy (confirm existence of shadow copy).

Note each of these 7 tests should include about 2 to 8 assertions that are
checked. Proper validation of your new tests will ideally include changing
the Drupal core code to break the tested functionality and then confirming
that your tests report a failure. Ideally, post each such change as a
patch to help the reviewers.

Original issue reported on code.google.com by pwola...@gmail.com on 26 Dec 2007 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 26 Dec 2007 at 1:08

GoogleCodeExporter commented 9 years ago
for reference on what's involved see these other tasks:

http://drupal.org/node/201134
http://drupal.org/node/201138
http://drupal.org/node/201139

Original comment by pwola...@gmail.com on 26 Dec 2007 at 5:01

GoogleCodeExporter commented 9 years ago
I claim this task.

Original comment by smartys on 26 Dec 2007 at 7:11

GoogleCodeExporter commented 9 years ago
OK smartys, this task is yours! Please post all of your followups to the Drupal
issue: http://drupal.org/node/203896

Original comment by addi.be...@gmail.com on 26 Dec 2007 at 8:52

GoogleCodeExporter commented 9 years ago
heh, 2008. :-)

Original comment by addi.be...@gmail.com on 26 Dec 2007 at 8:55

GoogleCodeExporter commented 9 years ago
Darn, and I was looking forward to inventing time travel too :P

Original comment by smartys on 26 Dec 2007 at 9:52

GoogleCodeExporter commented 9 years ago
I just added the code to the Drupal issue, but I'll attach it here as well.

Original comment by smartys on 27 Dec 2007 at 2:57

Attachments:

GoogleCodeExporter commented 9 years ago
marking for review

Original comment by addi.be...@gmail.com on 27 Dec 2007 at 3:39

GoogleCodeExporter commented 9 years ago
reviewed already- see Drupal issue.

Original comment by pwola...@gmail.com on 27 Dec 2007 at 3:49

GoogleCodeExporter commented 9 years ago
And here's the revised version:

Original comment by smartys on 27 Dec 2007 at 1:40

Attachments:

GoogleCodeExporter commented 9 years ago
see comments on the Drupal issue

Original comment by pwola...@gmail.com on 27 Dec 2007 at 2:00

GoogleCodeExporter commented 9 years ago
And another revised version :)

Original comment by smartys on 27 Dec 2007 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago
And now one that shouldn't fail if localization is used

Original comment by smartys on 27 Dec 2007 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
And a new one which corrects a capitalization error

Original comment by smartys on 27 Dec 2007 at 10:24

Attachments:

GoogleCodeExporter commented 9 years ago
And another which is more compact and which fixes some coding style issues.

Original comment by smartys on 28 Dec 2007 at 9:14

Attachments:

GoogleCodeExporter commented 9 years ago
Whoops, forgot to change some comments after compacting ;)

Original comment by smartys on 28 Dec 2007 at 9:33

Attachments:

GoogleCodeExporter commented 9 years ago
And another new version, which removes some redundancy

Original comment by smartys on 29 Dec 2007 at 10:28

Attachments:

GoogleCodeExporter commented 9 years ago
I think this is complete - good job.

Original comment by pwola...@gmail.com on 30 Dec 2007 at 2:17

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 21 Jan 2008 at 5:32