Re: Unit testing HTML_QuickForm2 forms

From: Date: Tue, 05 Jul 2011 13:23:07 +0000
Subject: Re: Unit testing HTML_QuickForm2 forms
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-31160@lists.php.net to get a copy of this message
Hi Christian, On 05.07.2011 17:00, Christian Weiske wrote:
I'm writing unit tests for my QF2 form validation rules and do it like this:
Unless you are doing something complex in your Rule (by complex I mean overriding methods other that validateOwner() / getJavascriptCallback() and setConfig()), you can follow the pattern we use in our unit tests:
Sorry, I described the problem wrong. What I meant: I am writing unit tests for my QF2 forms and want to verify the validation rules. I did not mean "unit tests for my custom rules".
If you want to check whether your form is valid given the specific input, then yes, yours is the way to go.

« previous php.pear.general (#31160) next »