You are here

protected function TextFieldRdfaTest::setUp in Drupal 10

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

File

core/modules/rdf/tests/src/Kernel/Field/TextFieldRdfaTest.php, line 38

Class

TextFieldRdfaTest
Tests RDFa output by text field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installConfig([
    'filter',
  ]);
  $this
    ->createTestField();

  // Add the mapping.
  $mapping = rdf_get_mapping('entity_test', 'entity_test');
  $mapping
    ->setFieldMapping($this->fieldName, [
    'properties' => [
      'schema:text',
    ],
  ])
    ->save();

  // Set up test entity.
  $this->entity = EntityTest::create();
  $this->entity->{$this->fieldName}->value = $this->testValue;
  $this->entity->{$this->fieldName}->summary = $this->testSummary;
}