You are here

protected function TelephoneFieldRdfaTest::setUp in Drupal 10

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

File

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

Class

TelephoneFieldRdfaTest
Tests RDFa output by telephone 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:telephone',
    ],
  ])
    ->save();

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