You are here

protected function NumberFieldRdfaTest::createTestEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php \Drupal\rdf\Tests\Field\NumberFieldRdfaTest::createTestEntity()

Creates the RDF mapping for the field.

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

... See full list

File

core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php, line 194
Contains \Drupal\rdf\Tests\Field\NumberFieldRdfaTest.

Class

NumberFieldRdfaTest
Tests RDFa output by number field formatters.

Namespace

Drupal\rdf\Tests\Field

Code

protected function createTestEntity($testValue) {

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

  // Set up test entity.
  $this->entity = entity_create('entity_test', array());
  $this->entity->{$this->fieldName}->value = $testValue;
}