protected function NumberFieldRdfaTest::createTestEntity in Drupal 9
Same name and namespace in other branches
- 8 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.
File
- core/
modules/ rdf/ tests/ src/ Kernel/ Field/ NumberFieldRdfaTest.php, line 192
Class
- NumberFieldRdfaTest
- Tests RDFa output by number field formatters.
Namespace
Drupal\Tests\rdf\Kernel\FieldCode
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;
}