How do you Unit Test a Zend_Form that includes the CSRF form element?
问题 I'm using the CSRF hidden hash element with Zend_Form and trying to Unit Test the login but don't know how to write a Unit Test to include that element. Looked in the docs and read as many tutorials as I could find. I even delicioused them all, but no one mentions this. 回答1: The correct hash is stored in the session, and the Hash form element has a Zend_Session_Namespace instance which contains the namespace for the hash. To unit test the element, you would replace the Zend_Session_Namespace