function NumberFieldRdfaTest::createTestEntity

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

Creates the RDF mapping for the field.

8 calls to NumberFieldRdfaTest::createTestEntity()
NumberFieldRdfaTest::testDecimalFormatter in core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
Tests the decimal formatter.
NumberFieldRdfaTest::testDecimalFormatterWithSettings in core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
Tests the decimal formatter with settings.
NumberFieldRdfaTest::testFloatFormatter in core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
Tests the float formatter.
NumberFieldRdfaTest::testFloatFormatterWithScale in core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
Tests the float formatter with a scale. Scale is not exercised.
NumberFieldRdfaTest::testFloatFormatterWithScaleExercised in core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php
Tests the float formatter with a scale. Scale is exercised.

... See full list

File

core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php, line 193

Class

NumberFieldRdfaTest
Tests RDFa output by number field formatters.

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

protected function createTestEntity($testValue) {
    // Add the mapping.
    $mapping = rdf_get_mapping('entity_test', 'entity_test');
    $mapping->setFieldMapping($this->fieldName, [
        'properties' => [
            'schema:baseSalary',
        ],
    ])
        ->save();
    // Set up test entity.
    $this->entity = EntityTest::create([]);
    $this->entity->{$this->fieldName}->value = $testValue;
}

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