function HalLinkManagerTest::testGetRelationInternalIds

Same name in other branches
  1. 8.9.x 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 225

Class

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

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);
}

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