You are here

public function LinkFieldRdfaTest::testAllFormattersFront 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::testAllFormattersFront()
  2. 9 core/modules/rdf/tests/src/Kernel/Field/LinkFieldRdfaTest.php \Drupal\Tests\rdf\Kernel\Field\LinkFieldRdfaTest::testAllFormattersFront()

Tests all formatters with link to frontpage.

File

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

Class

LinkFieldRdfaTest
Tests the placement of RDFa in link field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

public function testAllFormattersFront() {

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

  // Set up the expected result.
  $expected_rdf = [
    'value' => $this->uri . '/',
    'type' => 'uri',
  ];
  $this
    ->runTestAllFormatters($expected_rdf, 'front');
}