You are here

public function HalLinkManagerTest::testGetRelationInternalIds in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php \Drupal\Tests\hal\Kernel\HalLinkManagerTest::testGetRelationInternalIds()

@covers ::getRelationInternalIds

File

core/modules/hal/tests/src/Kernel/HalLinkManagerTest.php, line 224

Class

HalLinkManagerTest
@coversDefaultClass \Drupal\hal\LinkManager\LinkManager @group hal

Namespace

Drupal\Tests\hal\Kernel

Code

public function testGetRelationInternalIds() {

  /** @var \Drupal\hal\LinkManager\RelationLinkManagerInterface $relation_manager */
  $relation_manager = \Drupal::service('hal.link_manager.relation');
  $link = $relation_manager
    ->getRelationUri('node', 'page', 'field_ref');
  $internal_ids = $relation_manager
    ->getRelationInternalIds($link);
  $this
    ->assertEquals([
    'entity_type_id' => 'node',
    'bundle' => 'page',
    'field_name' => 'field_ref',
  ], $internal_ids);
}