You are here

public function TfaTestSend::validateForm in Two-factor Authentication (TFA) 7.2

Validate form.

Parameters

array $form: The form array structure.

array $form_state: The current form state array.

Return value

bool Whether form passes validation or not.

Overrides TfaValidationPluginInterface::validateForm

File

tests/includes/tfa_test.send.inc, line 54
Tests for the TfaSendPluginInterface.

Class

TfaTestSend
Class TfaTestSend.

Code

public function validateForm(array $form, array &$form_state) {
  if (!parent::validate($form_state['values']['code'])) {
    $this->errorMessages['code'] = t('Invalid sent code');
    return FALSE;
  }
  else {
    return TRUE;
  }
}