function FormBuilderTest::providerTestValueCallableIsSafe

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestValueCallableIsSafe()
  2. 8.9.x core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestValueCallableIsSafe()
  3. 10 core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php \Drupal\Tests\Core\Form\FormBuilderTest::providerTestValueCallableIsSafe()

File

core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php, line 822

Class

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

Namespace

Drupal\Tests\Core\Form

Code

public static function providerTestValueCallableIsSafe() {
    $data = [];
    $data['string_no_slash'] = [
        'Drupal\\Core\\Render\\Element\\Token::valueCallback',
        TRUE,
    ];
    $data['string_with_slash'] = [
        '\\Drupal\\Core\\Render\\Element\\Token::valueCallback',
        TRUE,
    ];
    $data['array_no_slash'] = [
        [
            'Drupal\\Core\\Render\\Element\\Token',
            'valueCallback',
        ],
        TRUE,
    ];
    $data['array_with_slash'] = [
        [
            '\\Drupal\\Core\\Render\\Element\\Token',
            'valueCallback',
        ],
        TRUE,
    ];
    $data['closure'] = [
        function () {
        },
        FALSE,
    ];
    return $data;
}

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