You are here

public static function JsWebAssertTestForm::addLink in Drupal 10

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

Ajax callback for the "Add link" button.

File

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

Class

JsWebAssertTestForm
Test form for JSWebAssert WebDriverTestBase.

Namespace

Drupal\js_webassert_test\Form

Code

public static function addLink(array $form, FormStateInterface $form_state) {
  $form['added_link'] = [
    '#title' => 'Added link',
    '#type' => 'link',
    '#url' => Url::fromRoute('js_webassert_test.js_webassert_test_form'),
  ];
  return $form;
}