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 SimpleTests for filter module #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Deliverables:

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:
http://drupal.org/node/210666

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-revolutio
n
http://drupal.org/handbook/modules/filter
http://api.drupal.org/api/file/developer/examples/filter_example.module/...
http://drupal.org/node/201285

Original issue reported on code.google.com by pwola...@gmail.com on 16 Jan 2008 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 16 Jan 2008 at 1:47

GoogleCodeExporter commented 9 years ago
I claim this task

Original comment by j.boomba...@gmail.com on 19 Jan 2008 at 4:47

GoogleCodeExporter commented 9 years ago
Awesome.  j.boombatower, it's yours.

Original comment by acli...@gmail.com on 19 Jan 2008 at 4:51

GoogleCodeExporter commented 9 years ago
Initial submission. Details at: http://drupal.org/node/210666.

Original comment by j.boomba...@gmail.com on 19 Jan 2008 at 7:42

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 19 Jan 2008 at 7:46

GoogleCodeExporter commented 9 years ago
Updated submission. Details at: http://drupal.org/node/210666.

Original comment by j.boomba...@gmail.com on 20 Jan 2008 at 12:09

GoogleCodeExporter commented 9 years ago
Hopefully final submission at http://drupal.org/node/210666.

Original comment by j.boomba...@gmail.com on 20 Jan 2008 at 10:37

GoogleCodeExporter commented 9 years ago
I am closing the issue as I think the last patch in the issue is adequate.

Original comment by chx1...@gmail.com on 21 Jan 2008 at 1:42

GoogleCodeExporter commented 9 years ago
Final submission

Original comment by j.boomba...@gmail.com on 21 Jan 2008 at 1:44

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by acli...@gmail.com on 21 Jan 2008 at 4:04