function ControllerResolverTest::testCreateControllerNonExistentClass

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

Tests createController() with a non-existent class.

File

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

Class

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

Namespace

Drupal\Tests\Core\Controller

Code

public function testCreateControllerNonExistentClass() {
    $this->expectException(\InvalidArgumentException::class);
    $this->controllerResolver
        ->getControllerFromDefinition('Class::method');
}

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