function FormBuilderTest::providerTestValueCallableIsSafe

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

File

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

Class

FormBuilderTest
Tests Drupal\Core\Form\FormBuilder.

Namespace

Drupal\Tests\Core\Form

Code

public static function providerTestValueCallableIsSafe() : array {
  $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 () : void {
    },
    FALSE,
  ];
  return $data;
}

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