function FieldRdfaTestBase::getAbsoluteUri

Same name and namespace in other branches
  1. 8.9.x core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php \Drupal\Tests\rdf\Kernel\Field\FieldRdfaTestBase::getAbsoluteUri()

Gets the absolute URI of an entity.

Parameters

\Drupal\Core\Entity\ContentEntityBase $entity: The entity for which to generate the URI.

Return value

string The absolute URI.

3 calls to FieldRdfaTestBase::getAbsoluteUri()
EntityReferenceRdfaTest::setUp in core/modules/rdf/tests/src/Kernel/Field/EntityReferenceRdfaTest.php
Set the default field storage backend for fields created during tests.
EntityReferenceRdfaTest::testAllFormatters in core/modules/rdf/tests/src/Kernel/Field/EntityReferenceRdfaTest.php
Tests all the entity reference formatters.
FieldRdfaDatatypeCallbackTest::setUp in core/modules/rdf/tests/src/Kernel/Field/FieldRdfaDatatypeCallbackTest.php
Set the default field storage backend for fields created during tests.

File

core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php, line 125

Class

FieldRdfaTestBase

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

protected function getAbsoluteUri($entity) {
    return $entity->toUrl('canonical', [
        'absolute' => TRUE,
    ])
        ->toString();
}

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