Enabling and modifying input formats is a key administrative and security task for any Drupal site. However, a human tester rarely will check a new patch to insure that it does not break some part of this functionality. For example, this unfortunate SNAFU: http://drupal.org/node/208700 demonstrates again the need for unit tests for the filter module.

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.

Your overall task will be to create a set of tests that thoroughly tests the administrative interface of the filter 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: XXX

Suggested tests/components to be written for this task:

1. Save all the original settings (e.g. you might even rename and duplicate the table) so you can revert to them.
2. admin/settings/filters change the default filter by POST. Check that the new default shows up and cannot be deleted.
3.admin/settings/filters/1/configure Add an additional tag, check that is shows up, and check that the filter cache is cleared
4 admin/settings/filters/1/order reorder the input formats by POST, and check that the changes are saved.
5. settings/filters/add add a new input format by POST and check that it is saved and has all selected options
6.settings/filters/delete/x check that the newly added format can be deleted
7. admin/settings/filters/2 allow authenticated users, log in as a normal user and check access to the filter.

Note, you can assume the default filtered and full HTML filters are 1 and 2 (though bonus points for checking or making it so). Revert to the original filters when you are done.

Your test should either work for Drupal 5.x as well as 6.x, or provide both 5.x and 6.x versions.

Note each of these 3 tests should include at least 3 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.

Resources:
http://drupal.org/simpletest
http://drupal.org/project/simpletest
http://www.lullabot.com/articles/introduction-unit-testing
http://cwgordon.com/the-power-of-drupal-simpletests-and-the-simpletest-r...

Comments

aclight’s picture

Status: Needs review » Reviewed & tested by the community

This looks good, except for one thing. Can you modify this to have a specific "Deliverables:" section that includes the text below, so it is a little more obvious what the deliverable is. I'll set this as RTBC but you can make that change before taskifying.

Your overall task will be to create a set of tests that thoroughly tests the administrative interface of the filter 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: XXX

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed
webchick’s picture

Status: Fixed » Closed (fixed)

Closing, just so this stays off the queue list.