function DefaultHtmlRouteProviderTest::testGetEntityTypeIdKeyTypeNotFieldable

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()
  2. 10 core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php \Drupal\Tests\Core\Entity\Routing\DefaultHtmlRouteProviderTest::testGetEntityTypeIdKeyTypeNotFieldable()
  3. 11.x 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

Class

DefaultHtmlRouteProviderTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21Routing%21DefaultHtmlRouteProvider.php/class/DefaultHtmlRouteProvider/8.9.x" title="Provides HTML routes for entities." class="local">\Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider</a> @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);
}

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