If during a test you post to a form, and an error occurs in the form it should by default assert an error within the test.
However there if the test is checking for the existence of an error then it should have a different command from $this->drupalPost() that will ignore any errors that produced and maybe even a method of asserting based on the content of the error messages.
The second case is not really the norm, so by default the tests should check the for errors and allow the test author to code around any "known" errors.
I am marking this as critical as this maybe a larger issue where errors maybe being produced during tests but being ignored. I actually found this during testing of some issues in e-Commerce.
Comments
Comment #1
gordon commentedHere is some code that I wrote which would add the drupal messages to the headers so that they could be past back to $this->drupalPost() so that they can be asserted.
This is a class that I wrote which extended and added this functionality.
And code to allow the passing back of the error messages.
I don't think this is the best method of doing this as I will not able to find the best way to have it disabled when you are not running simpletest, but maybe it will give someone some ideas.
Gordon.
Comment #2
dave reidThis is a feature request, not a bug report.