PHPunit validation fails after ZF form validation

I am new to phpunit testing. Can someone help me on how to check the lines below in the image.

Img example

So far my test is:

public function testCanSendEmail()
{
    $formData = array(
        'subject'   => 'test subject',
        'email'     => 'test@mail.com',
        'message'   => 'test message',
        'name'      => 'test name');

    $this->request
        ->setMethod('POST')
        ->setPost($formData);
    $this->dispatch('/contact');
    $this->assertAction('win');

I got the impression that if the verification is successful, will it follow all the action? Can someone explain what is happening here, as well as what will be the right test for such an action.

+3
source share
1 answer

The obvious explanation is what $form->isValidreturns FALSE.

, if . else. , , . Debugger , , .

, TRUE. , http://sebastian-bergmann.de/archives/885-Stubbing-Hard-Coded-Dependencies.html , .

: , .

+1

Source: https://habr.com/ru/post/1787957/


All Articles