public function EntityTypeManagerTest::testGetHandlerMissingHandler in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testGetHandlerMissingHandler()
- 9 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
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeManagerTest.php, line 291 - Contains \Drupal\Tests\Core\Entity\EntityTypeManagerTest.
Class
- EntityTypeManagerTest
- @coversDefaultClass \Drupal\Core\Entity\EntityTypeManager @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testGetHandlerMissingHandler() {
$entity = $this
->prophesize(EntityTypeInterface::class);
$entity
->getHandlerClass('storage')
->willReturn('');
$this
->setUpEntityTypeDefinitions([
'test_entity_type' => $entity,
]);
$this
->expectException(InvalidPluginDefinitionException::class);
$this->entityTypeManager
->getHandler('test_entity_type', 'storage');
}