function DefaultHtmlRouteProviderTest::testGetEntityTypeIdKeyTypeNotFieldable

Tests get entity type id key type not fieldable.

@legacy-covers ::getEntityTypeIdKeyType

File

core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php, line 388

Class

DefaultHtmlRouteProviderTest
Tests Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider.

Namespace

Drupal\Tests\Core\Entity\Routing

Code

public function testGetEntityTypeIdKeyTypeNotFieldable() : void {
  $entity_type = $this->prophesize(EntityTypeInterface::class);
  $entity_type->entityClassImplements(FieldableEntityInterface::class)
    ->willReturn(FALSE);
  $this->entityFieldManager
    ->getFieldStorageDefinitions(Argument::any())
    ->shouldNotBeCalled();
  $type = $this->routeProvider
    ->getEntityTypeIdKeyType($entity_type->reveal());
  $this->assertNull($type);
}

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