function LinkFieldRdfaTest::testAllFormattersExternal

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

Tests all formatters with link to external page.

File

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

Class

LinkFieldRdfaTest
Tests the placement of RDFa in link field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

public function testAllFormattersExternal() {
  // Set up test values.
  $this->testValue = 'http://test.me/foo/bar/neque/porro/quisquam/est/qui-dolorem?path=foo/bar/neque/porro/quisquam/est/qui-dolorem';
  $this->entity = EntityTest::create([]);
  $this->entity->{$this->fieldName}->uri = $this->testValue;
  // Set up the expected result.
  $expected_rdf = [
    'value' => $this->testValue,
    'type' => 'uri',
  ];
  $this->runTestAllFormatters($expected_rdf, 'external');
}

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