You are here

public function FormBuilderTest::providerTestValueCallableIsSafe in Drupal 8

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

File

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

Class

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

Namespace

Drupal\Tests\Core\Form

Code

public 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;
}