You are here

public function EntityTypeManagerTest::testGetHandlerMissingHandler in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testGetHandlerMissingHandler()

Tests the getHandler() method when no controller is defined.

@covers ::getHandler

@expectedException \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php, line 289
Contains \Drupal\Tests\Core\Entity\EntityTypeManagerTest.

Class

EntityTypeManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityTypeManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetHandlerMissingHandler() {
  $entity = $this
    ->prophesize(EntityTypeInterface::class);
  $entity
    ->getHandlerClass('storage')
    ->willReturn('');
  $this
    ->setUpEntityTypeDefinitions([
    'test_entity_type' => $entity,
  ]);
  $this->entityTypeManager
    ->getHandler('test_entity_type', 'storage');
}