You are here

protected function NormalizeTest::getEntityUri in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/hal/src/Tests/NormalizeTest.php \Drupal\hal\Tests\NormalizeTest::getEntityUri()

Constructs the entity URI.

Parameters

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

Return value

string The entity URI.

1 call to NormalizeTest::getEntityUri()
NormalizeTest::testNormalize in core/modules/hal/src/Tests/NormalizeTest.php
Tests the normalize function.

File

core/modules/hal/src/Tests/NormalizeTest.php, line 179
Contains \Drupal\hal\Tests\NormalizeTest.

Class

NormalizeTest
Tests that entities can be normalized in HAL.

Namespace

Drupal\hal\Tests

Code

protected function getEntityUri(EntityInterface $entity) {
  $url = $entity
    ->urlInfo('canonical', [
    'absolute' => TRUE,
  ]);
  return $url
    ->setRouteParameter('_format', 'hal_json')
    ->toString();
}