You are here

public function DefaultHtmlRouteProviderTest::testGetEntityTypeIdKeyTypeNotFieldable in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php \Drupal\Tests\Core\Entity\Routing\DefaultHtmlRouteProviderTest::testGetEntityTypeIdKeyTypeNotFieldable()

@covers ::getEntityTypeIdKeyType

File

core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php, line 327
Contains \Drupal\Tests\Core\Entity\Routing\DefaultHtmlRouteProviderTest.

Class

DefaultHtmlRouteProviderTest
@coversDefaultClass \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider @group Entity

Namespace

Drupal\Tests\Core\Entity\Routing

Code

public function testGetEntityTypeIdKeyTypeNotFieldable() {
  $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);
}