Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The main work for this task is to write a small suite of tests to check the basic functionality of Actions associated with changes to site content. This suite should be written as a single .test file.
Suggested tests:
1. admin/build/actions/assign/node Assign an action. Trigger the action and make sure it fires.
2. admin/build/actions/assign/node Attempt to assign the same action twice. Confirm error.
3. admin/build/actions/assign/node Remove an assigned action. Make sure it no longer fires.
Comment | File | Size | Author |
---|---|---|---|
#20 | content_actions-201139-20.patch | 3.95 KB | pwolanin |
#19 | break_node.patch | 689 bytes | pwolanin |
#19 | break_reassign.patch | 731 bytes | pwolanin |
#19 | break_assign.patch | 648 bytes | pwolanin |
#17 | ghop 112.txt | 3.09 KB | kyl191 |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedlink to task: http://code.google.com/p/google-highly-open-participation-drupal/issues/...
Comment #2
cwgordon7 CreditAttribution: cwgordon7 commentedFile attached as a .txt. If anything fails it's because it's a critical Drupal core issue, not because anything's wrong with this file.
Comment #3
snufkin CreditAttribution: snufkin commentedusing chx's patch from http://drupal.org/node/203509 and enabling trigger the test runs, without fail. Coding style looks good, strings in t().
Testing an error situation with reverting the patch mentioned above gives me a nice error, so does running it without trigger enabled, so it indeed functions well.
Comment #4
cwgordon7 CreditAttribution: cwgordon7 commentedThanks for the review, pwolanin. Test rerolled.
Comment #5
pwolanin CreditAttribution: pwolanin commentednote - in IRC I suggested writing the aid as
md5(callback)
for readability, testing all 6 actions, and comparing$node->status
, etc to an int rather than a string.Comment #6
pwolanin CreditAttribution: pwolanin commentedThis code comment needs fixing:
Also, there is a random $i in various calls like:
Comment #7
cwgordon7 CreditAttribution: cwgordon7 commentedThanks, test file rerolled.
Comment #8
pwolanin CreditAttribution: pwolanin commentedwhy $action rather than $this->actionName($action)? you shouldn't concat like that in t()
t('Check to make sure the "'. $action .'" action is fired.'));
look at your code below:
t('Action %action has been unassigned.', array('%action' => $this->actionName($action)))
that's a better model
Comment #9
cwgordon7 CreditAttribution: cwgordon7 commentedOk, rerolled. Except with @action.
Comment #10
pwolanin CreditAttribution: pwolanin commentedwhy not:
Comment #11
cwgordon7 CreditAttribution: cwgordon7 commentedOk, rerolled.
Comment #12
cwgordon7 CreditAttribution: cwgordon7 commentedOk, rerolled (again).
Comment #13
cwgordon7 CreditAttribution: cwgordon7 commentedOk, following our discussion on IRC, this patch is rerolled & shortened significantly.
Comment #14
pwolanin CreditAttribution: pwolanin commentedThere is something weird going on with trigger/actions when trying to sequentially run several sequentially. Also, we found this bug - need to patch to make this work on PHP4.4: http://drupal.org/node/203846
So - this issue demonstrates the value of this exercise - we turned up 2 core bugs! Thanks cwgordon7
Comment #15
cwgordon7 CreditAttribution: cwgordon7 commentedRerolled
Comment #16
cwgordon7 CreditAttribution: cwgordon7 commentedWhoops. Rerolled.
Comment #17
kyl191 CreditAttribution: kyl191 commentedHi,
took a look at the test, and everything seems fine - the test came back with 6 failures, but the failures don't look related to the test.
(Disclaimer: Not only am I a student who is taking part in GHOP, but I am also not an expert in simpletest. But the test still looks ok to me.)
The output of the test is attached if anyone's interested in it.
Comment #18
cwgordon7 CreditAttribution: cwgordon7 commentedAdding on to what kyl191 said: The tests kyl191 performed were without chx's patch, so failures were to be expected.
Comment #19
pwolanin CreditAttribution: pwolanin commentedsome trivial patches that break the tests
Comment #20
pwolanin CreditAttribution: pwolanin commentedI did a quick fix on a couple of the error messages, and re-rolled this in patch form (diffed from the simpletest module directory). Looks good to me.
Comment #21
pwolanin CreditAttribution: pwolanin commented@cwgordon7: please post the final version to the GHOP queue
Comment #22
Rok Žlender CreditAttribution: Rok Žlender commentedCommitted thanks.
Comment #23
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.