function FormBuilderTest::providerTestBuildFormWithTriggeringElement

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

Class

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

Namespace

Drupal\Tests\Core\Form

Code

public static 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.