ValidationTest::testValidationCancelOnFail PHP Method

testValidationCancelOnFail() public method

    public function testValidationCancelOnFail()
    {
        $validation = new Phalcon\Validation();
        $validation->add('name', new PresenceOf(array('message' => 'The name is required')))->add('email', new PresenceOf(array('message' => 'The email is required', 'cancelOnFail' => true)))->add('login', new PresenceOf(array('message' => 'The login is required')));
        $messages = $validation->validate([]);
        $expectedMessages = Phalcon\Validation\Message\Group::__set_state(array('_messages' => array(0 => Phalcon\Validation\Message::__set_state(array('_type' => 'PresenceOf', '_message' => 'The name is required', '_field' => 'name', '_code' => '0')), 1 => Phalcon\Validation\Message::__set_state(array('_type' => 'PresenceOf', '_message' => 'The email is required', '_field' => 'email', '_code' => '0')))));
        $this->assertEquals($messages, $expectedMessages);
    }