You are here

public function LinkFieldRdfaTest::testAllFormattersInternal in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rdf/tests/src/Kernel/Field/LinkFieldRdfaTest.php \Drupal\Tests\rdf\Kernel\Field\LinkFieldRdfaTest::testAllFormattersInternal()
  2. 9 core/modules/rdf/tests/src/Kernel/Field/LinkFieldRdfaTest.php \Drupal\Tests\rdf\Kernel\Field\LinkFieldRdfaTest::testAllFormattersInternal()

Tests all formatters with link to internal page.

File

core/modules/rdf/tests/src/Kernel/Field/LinkFieldRdfaTest.php, line 61

Class

LinkFieldRdfaTest
Tests the placement of RDFa in link field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

public function testAllFormattersInternal() {

  // Set up test values.
  $this->testValue = 'admin';
  $this->entity = EntityTest::create([]);
  $this->entity->{$this->fieldName}->uri = 'internal:/admin';

  // Set up the expected result.
  // AssertFormatterRdfa looks for a full path.
  $expected_rdf = [
    'value' => $this->uri . '/' . $this->testValue,
    'type' => 'uri',
  ];
  $this
    ->runTestAllFormatters($expected_rdf, 'internal');
}