You are here

public function RendererCallbackTest::providerTestCallback in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php \Drupal\Tests\Core\Render\RendererCallbackTest::providerTestCallback()

Data provider for testCallback().

File

core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php, line 46

Class

RendererCallbackTest
@coversDefaultClass \Drupal\Core\Render\Renderer @group Render @group legacy Once Renderer::doCallback() throws exceptions this will no longer be a legacy test.

Namespace

Drupal\Tests\Core\Render

Code

public function providerTestCallback() {
  return [
    'Procedural function pre render' => [
      [
        '#pre_render' => [
          '\\Drupal\\Tests\\Core\\Render\\callback',
        ],
        '#type' => 'container',
      ],
      'Render #pre_render callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was \\Drupal\\Tests\\Core\\Render\\callback. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725',
    ],
    'Static object method post render' => [
      [
        '#post_render' => [
          '\\Drupal\\Tests\\Core\\Render\\RendererCallbackTest::renderCallback',
        ],
        '#type' => 'container',
      ],
      'Render #post_render callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was \\Drupal\\Tests\\Core\\Render\\RendererCallbackTest::renderCallback. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725',
    ],
    'Object method access callback' => [
      [
        '#access_callback' => [
          $this,
          'renderCallback',
        ],
        '#type' => 'container',
      ],
      'Render #access_callback callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\\Tests\\Core\\Render\\RendererCallbackTest::renderCallback. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725',
    ],
    'Procedural function lazy builder' => [
      [
        '#lazy_builder' => [
          '\\Drupal\\Tests\\Core\\Render\\callback',
          [],
        ],
      ],
      'Render #lazy_builder callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was \\Drupal\\Tests\\Core\\Render\\callback. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725',
    ],
    'Invokable object access callback' => [
      [
        '#access_callback' => $this,
        '#type' => 'container',
      ],
      'Render #access_callback callbacks must be methods of a class that implements \\Drupal\\Core\\Security\\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\\Tests\\Core\\Render\\RendererCallbackTest. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725',
    ],
  ];
}