GHOP #124 Simpletests for Actions and Triggers

add1sun - December 31, 2007 - 18:02
Project:SimpleTest
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:cwgordon7
Status:closed
Description

Creating a workflow with the actions and triggers system
is a key administrative task for any Drupal site. However,
would you manually check each new patch 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.

Your overall task will be to create an ActionsTestCase class which would
be the basis for all actions/triggers test cases. The first step of the
task will be to evaluate functions that would be useful in an ActionsTestCase.
Compile a list of at least ten (10) functions that might be useful for the
ActionsTestCase. Next, you will create the easily extendable class, with
all of the functions proposed (through in a few more for kicks if you want).
Last, you must make five (5) tests that extend the ActionsTestCase, to
demonstrate the usage of the new class.

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...

GHOP issue: http://code.google.com/p/google-highly-open-participation-drupal/issues/...

#1

dmitrig01 - December 31, 2007 - 19:12

Claimed by cwgordon7

#2

cwgordon7 - January 4, 2008 - 02:35
Assigned to:Anonymous» cwgordon7

actions_test_case.php, the "easily extendable class", is attached.

AttachmentSize
Click here to download a virus! (Just kidding...)5.15 KB

#3

dmitrig01 - January 4, 2008 - 20:14

Looks good!
I hereby approve you to go further.

#4

cwgordon7 - January 6, 2008 - 07:47
Status:active» patch (code needs review)

Needs review

AttachmentSize
simpletest_actions.patch596 bytes
various_tests_to_be_placed_in_tests_folder.zip3.43 KB
actions_test_case.php_.txt5.17 KB

#5

cwgordon7 - January 6, 2008 - 21:12

Revised, and reattached

AttachmentSize
zipped_files_2.zip3.45 KB

#6

cwgordon7 - March 19, 2008 - 02:19
Status:patch (code needs review)» patch (code needs work)

This needs serious work.

#7

boombatower - May 20, 2008 - 19:44
Status:patch (code needs work)» fixed

This was committed a long time ago.

The thread to clean up the test is now located http://drupal.org/node/260501.

#8

Anonymous (not verified) - June 3, 2008 - 19:44
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.