function ReflectionTest::providerGetParameterClassName

Data provider for ::testGetParameterClassName().

Return value

array[] An array of test cases. Each test case is an associative array containing:

  • string|null $expected: The expected class name.
  • \ReflectionParameter $parameter: The reflection parameter.

File

core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php, line 41

Class

ReflectionTest
Tests Drupal\Component\Utility\Reflection.

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerGetParameterClassName() {
  $reflection_method = new \ReflectionMethod(static::class, 'existsForTesting');
  $parameters = $reflection_method->getParameters();
  return [
    'string' => [
      NULL,
      $parameters[0],
    ],
    'array' => [
      NULL,
      $parameters[1],
    ],
    'same class' => [
      'Drupal\\Tests\\Component\\Utility\\ReflectionTest',
      $parameters[2],
    ],
    'class' => [
      'Drupal\\Component\\Utility\\Reflection',
      $parameters[3],
    ],
    'parent' => [
      'PHPUnit\\Framework\\TestCase',
      $parameters[4],
    ],
    'self' => [
      'Drupal\\Tests\\Component\\Utility\\ReflectionTest',
      $parameters[5],
    ],
  ];
}

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