You are here

public function ControllerResolverTest::testCreateControllerNonExistentClass in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::testCreateControllerNonExistentClass()
  2. 9 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 94
Contains \Drupal\Tests\Core\Controller\ControllerResolverTest.

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');
}