You are here

public function ControllerResolverTest::providerTestCreateController in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::providerTestCreateController()

Provides test data for testCreateController().

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 81
Contains \Drupal\Tests\Core\Controller\ControllerResolverTest.

Class

ControllerResolverTest
@coversDefaultClass \Drupal\Core\Controller\ControllerResolver @group Controller

Namespace

Drupal\Tests\Core\Controller

Code

public function providerTestCreateController() {
  return [
    // Tests class::method.
    [
      'Drupal\\Tests\\Core\\Controller\\MockController::getResult',
      'Drupal\\Tests\\Core\\Controller\\MockController',
      'This is a regular controller.',
    ],
    // Tests service:method.
    [
      'some_service:getResult',
      'Drupal\\Tests\\Core\\Controller\\MockController',
      'This is a regular controller.',
    ],
    // Tests a class with injection.
    [
      'Drupal\\Tests\\Core\\Controller\\MockContainerInjection::getResult',
      'Drupal\\Tests\\Core\\Controller\\MockContainerInjection',
      'This used injection.',
    ],
    // Tests a ContainerAware class.
    [
      'Drupal\\Tests\\Core\\Controller\\MockContainerAware::getResult',
      'Drupal\\Tests\\Core\\Controller\\MockContainerAware',
      'This is container aware.',
    ],
  ];
}