3
我是phpunit測試的全新產品。任何人都可以幫助我如何測試圖像中下方的線條。ZF表單驗證後未完成PHPunit測試
到目前爲止,我的測試是:
public function testCanSendEmail()
{
$formData = array(
'subject' => 'test subject',
'email' => '[email protected]',
'message' => 'test message',
'name' => 'test name');
$this->request
->setMethod('POST')
->setPost($formData);
$this->dispatch('/contact');
$this->assertAction('win');
我的印象是,如果驗證成功,將貫徹整個動作?任何人都可以請解釋一下這裏發生的事情,以及這樣一個行動的正確測試。
你可以在$ this-> dispatch('/ contact');下面的var_dump($ this-> getResponse() - > getBody());這將返回html正文,也許你將能夠看到是否顯示任何驗證錯誤消息。 – Marcin 2011-01-26 15:03:23