You are here

public function FormBuilderTest::providerTestBuildFormWithTriggeringElement in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestBuildFormWithTriggeringElement()

Data provider for ::testBuildFormWithTriggeringElement().

File

core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php, line 328
Contains \Drupal\Tests\Core\Form\FormBuilderTest.

Class

FormBuilderTest
@coversDefaultClass \Drupal\Core\Form\FormBuilder @group Form

Namespace

Drupal\Tests\Core\Form

Code

public function providerTestBuildFormWithTriggeringElement() {
  $plain_text = 'Other submit value';
  $markup = 'Other submit <input> value';
  return [
    'plain-text' => [
      $plain_text,
      $plain_text,
    ],
    'markup' => [
      $markup,
      $markup,
    ],
    // Note: The input is always decoded, see
    // \Drupal\Core\Form\FormBuilder::buttonWasClicked, so we do not need to
    // escape the input.
    'escaped-markup' => [
      Html::escape($markup),
      $markup,
    ],
  ];
}