function ControllerResolverTest::testCreateController

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::testCreateController()
  2. 8.9.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::testCreateController()
  3. 11.x core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::testCreateController()

Tests createController().

@dataProvider providerTestCreateController @group legacy

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 57

Class

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

Namespace

Drupal\Tests\Core\Controller

Code

public function testCreateController($controller, $class, $output, ?string $deprecation = NULL) : void {
    if ($deprecation) {
        $this->expectDeprecation($deprecation);
    }
    $this->container
        ->set('some_service', new MockController());
    $result = $this->controllerResolver
        ->getControllerFromDefinition($controller);
    $this->assertCallableController($result, $class, $output);
}

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