function VariableTest::providerCallableToString
Data provider for testCallableToString().
Return value
array[] Sets of arguments to pass to the test method.
File
- 
              core/tests/ Drupal/ Tests/ Component/ Utility/ VariableTest.php, line 35 
Class
- VariableTest
- Test variable export functionality in Variable component.
Namespace
Drupal\Tests\Component\UtilityCode
public function providerCallableToString() : array {
  $self = static::class;
  return [
    'string' => [
      "{$self}::fake",
      "{$self}::fake",
    ],
    'static method as array' => [
      [
        $self,
        'fake',
      ],
      "{$self}::fake",
    ],
    'closure' => [
      function () {
        return NULL;
      },
      '[closure]',
    ],
    'object method' => [
      [
        new static(),
        'fake',
      ],
      "{$self}::fake",
    ],
    'service method' => [
      'fake_service:method',
      'fake_service:method',
    ],
    'single-item array' => [
      [
        'some_function',
      ],
      'some_function',
    ],
    'empty array' => [
      [],
      '[unknown]',
    ],
    'object' => [
      new \stdClass(),
      '[unknown]',
    ],
    'definitely not callable' => [
      TRUE,
      '[unknown]',
    ],
  ];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
