You are here

public static function JsWebAssertTestForm::addButton in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addButton()
  2. 10 core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addButton()

Ajax callback for the "Add button" button.

File

core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php, line 138

Class

JsWebAssertTestForm
Test form for JSWebAssert JavaScriptTestBase.

Namespace

Drupal\js_webassert_test\Form

Code

public static function addButton(array $form, FormStateInterface $form_state) {
  $form['added_button'] = [
    '#type' => 'submit',
    '#value' => 'Added button',
    '#button_type' => 'primary',
  ];
  return $form;
}