You are here

protected function DateTimeFieldRdfaTest::setUp in Drupal 10

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

File

core/modules/rdf/tests/src/Kernel/Field/DateTimeFieldRdfaTest.php, line 31

Class

DateTimeFieldRdfaTest
Tests RDFa output by datetime field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->createTestField();

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

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