function ControllerResolverTest::providerTestCreateController

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::providerTestCreateController()
  2. 10 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::providerTestCreateController()
  3. 11.x 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

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.',
        ],
    ];
}

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