function HalLinkManagerTest::testGetRelationInternalIds
Same name and namespace in other branches
- 9 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 253
Class
- HalLinkManagerTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21hal%21src%21LinkManager%21LinkManager.php/class/LinkManager/8.9.x" title="LinkManager" class="local">\Drupal\hal\LinkManager\LinkManager</a> @group hal @group legacy
Namespace
Drupal\Tests\hal\KernelCode
public function testGetRelationInternalIds() {
/* @var \Drupal\rest\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',
'entity_type' => \Drupal::entityTypeManager()->getDefinition('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.