function FormBuilderTest::providerTestBuildFormWithTriggeringElement

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestBuildFormWithTriggeringElement()
  2. 10 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestBuildFormWithTriggeringElement()
  3. 11.x 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

Class

FormBuilderTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Form%21FormBuilder.php/class/FormBuilder/8.9.x" title="Provides form building and processing." class="local">\Drupal\Core\Form\FormBuilder</a> @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,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.