Trying to add tests for #582584: form_required_marker() isn't passed the form element (theme_hook definition is wrong) led me to look closely at FormsTestCase::testRequiredFields() from modules/simpletest/tests/form.test. It's broken in various ways:
A) It never calls form_clear_error() so it's often operating on stale form error messages.
B) Every form in there is failing with 'form_token' => 'Validation error, please try again. If this error persists, please contact the site administrator.' -- seems like the way we're building/executing the forms is bogus in some way.
C) It'd be nice to test that if each of those dummy form elements is *not* marked required that you do *not* see a form error when trying to submit them with empty input.
Moving this to a separate bug report so as not to cram too many changes into #582584.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 582956-1.required_form_tests.patch | 5.96 KB | dww |
Comments
Comment #1
dwwComment #2
dwwNote: patch #1 still doesn't address (B). Not sure if it really matters. I'd like chx or another FAPI expert to comment.
Comment #3
damien tournoud commentedMakes sense and works. I'm a little bit concerned about those tests: Form API is too big a beast to try unit-testing it likes this (or we end up with (B) :p). We should rewrite those tests at one point.
Comment #4
dwwGentle ping to committers: this is holding up progress on other patches I'd like to work on... Thanks. ;)
Comment #5
dries commentedCommitted to CVS HEAD.