You are here

public function FormTestLimitValidationErrorsForm::partialSubmitForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php \Drupal\form_test\Form\FormTestLimitValidationErrorsForm::partialSubmitForm()

File

core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php, line 106
Contains \Drupal\form_test\Form\FormTestLimitValidationErrorsForm.

Class

FormTestLimitValidationErrorsForm
Builds a simple form with a button triggering partial validation.

Namespace

Drupal\form_test\Form

Code

public function partialSubmitForm(array &$form, FormStateInterface $form_state) {

  // The title has not been validated, thus its value - in case of the test case
  // an empty string - may not be set.
  if (!$form_state
    ->hasValue('title') && $form_state
    ->hasValue('test')) {
    drupal_set_message('Only validated values appear in the form values.');
  }
}