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.
This information is from the code coverage report (see http://coverage.cwgordon.com/coverage).
We need to test:
1) Attempting to have no category name for a site-wide contact form category.
2) Attempting to have no recipients for a site-wide contact form category.
3) Updating a site-wide contact form category.
Comment | File | Size | Author |
---|---|---|---|
#11 | contact_test.patch | 2.91 KB | andreiashu |
#9 | contact_test.patch | 2.44 KB | andreiashu |
#4 | contacttest.patch | 2.49 KB | catch |
Comments
Comment #1
harrisben CreditAttribution: harrisben commented1) Navigating to /contact or via the contact menu item (after enabling it) without setting up a category presents an error message "The contact form has not been configured. Add one or more categories to the form", which correctly provides a link directly to the settings page to add a contact form category.
2) When adding a contact form category the form correctly requires a valid email-formatted recipient.
Not sure if it's intended, but the contact form settings page doesn't have the same drag-and-drop prioritising that modules such as blocks and taxonomy have. It would be good to have it for consistency.
Comment #2
cwgordon7 CreditAttribution: cwgordon7 commentedI mean automated tests. Not manual ones.
Comment #3
harrisben CreditAttribution: harrisben commentedoh, then please disregard my other posts...
Comment #4
catch#1 and #2 are dead code - both those fields are
'#required' => TRUE
which means they never get to validation, so that can never be run.So this patch adds a test to ensure the requirement is set (so covers the behaviour for #1 and #2), and removes the redundant validation code for empty fields. That'll mean it gets caught if someone tries to removed the '#required' => TRUE later on. Doesn't touch #3 at all.
contact.test has four known failures #253506 which are unaffected by this patch.
Nice side effect of the code coverage reports :)
Comment #5
dmitrig01 CreditAttribution: dmitrig01 commentedI'm not so sure this is gonna work
Comment #6
catchdmitrig01, it's not supposed to. Or did you mean something else?
Comment #7
Dries CreditAttribution: Dries commentedI think this patch looks good. Committed to CVS HEAD.
Comment #8
catchThanks.
We're still missing #3, so markin back to active for that one.
Comment #9
andreiashu CreditAttribution: andreiashu commentedThis is my first patch.
Is it enough to test for the text "Category %category has been added." or should i take every filed and test if it has been updated ?
Comment #10
cwgordon7 CreditAttribution: cwgordon7 commentedThis needs to comply to coding standards, first of all. Please see http://drupal.org/coding-standards.
I'd also add a check for the category updates in the database.
Comment #11
andreiashu CreditAttribution: andreiashu commentedcwgordon7, thanks for suggestion. I think now the coding standards should be fine. I also added db category updates check.
Have a look.
Comment #12
cwgordon7 CreditAttribution: cwgordon7 commentedLooks great. Tests all pass. RTBC.
Comment #13
Dries CreditAttribution: Dries commentedBack from vacation -- see http://buytaert.net/houffalize. Committed to CVS HEAD. Will be working the patch queue the next couple of days.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.