You are here

protected function ViewsIntegrationTest::getArgumentFromEntity in Entity Reference Hierarchy 3.x

Gets the views argument from a given entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity.

Return value

int The views argument/contextual filter value.

5 calls to ViewsIntegrationTest::getArgumentFromEntity()
ViewsIntegrationTest::testViewsIntegrationDirectChildren in tests/src/Kernel/ViewsIntegrationTest.php
Tests views integration.
ViewsIntegrationTest::testViewsIntegrationIncludingGrandChildren in tests/src/Kernel/ViewsIntegrationTest.php
Tests views integration.
ViewsIntegrationTest::testViewsIntegrationParents in tests/src/Kernel/ViewsIntegrationTest.php
Tests views integration.
ViewsIntegrationTest::testViewsIntegrationSiblings in tests/src/Kernel/ViewsIntegrationTest.php
Tests views sibling integration.
ViewsIntegrationTest::testViewsIntegrationSiblingsShowSelf in tests/src/Kernel/ViewsIntegrationTest.php
Tests views sibling integration with show_self enabled.
1 method overrides ViewsIntegrationTest::getArgumentFromEntity()
ViewsRevisionableIntegrationTest::getArgumentFromEntity in tests/src/Kernel/ViewsRevisionableIntegrationTest.php
Gets the views argument from a given entity.

File

tests/src/Kernel/ViewsIntegrationTest.php, line 58

Class

ViewsIntegrationTest
Defines a class for testing views integration.

Namespace

Drupal\Tests\entity_hierarchy\Kernel

Code

protected function getArgumentFromEntity(ContentEntityInterface $entity) : int {
  return $entity
    ->id();
}