Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
tests
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2008 at 05:46 UTC
Updated:
16 Aug 2008 at 05:18 UTC
Jump to comment: Most recent file
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 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 commentedI mean automated tests. Not manual ones.
Comment #3
harrisben commentedoh, then please disregard my other posts...
Comment #4
catch#1 and #2 are dead code - both those fields are
'#required' => TRUEwhich 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 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 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 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 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 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 commentedLooks great. Tests all pass. RTBC.
Comment #13
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) commentedAutomatically closed -- issue fixed for two weeks with no activity.