public function NumberFieldRdfaTest::testIntegerFormatter in Drupal 8
Same name and namespace in other branches
- 9 core/modules/rdf/tests/src/Kernel/Field/NumberFieldRdfaTest.php \Drupal\Tests\rdf\Kernel\Field\NumberFieldRdfaTest::testIntegerFormatter()
Tests the integer formatter.
File
- core/
modules/ rdf/ tests/ src/ Kernel/ Field/ NumberFieldRdfaTest.php, line 17
Class
- NumberFieldRdfaTest
- Tests RDFa output by number field formatters.
Namespace
Drupal\Tests\rdf\Kernel\FieldCode
public function testIntegerFormatter() {
$this->fieldType = 'integer';
$testValue = 3;
$this
->createTestField();
$this
->createTestEntity($testValue);
$this
->assertFormatterRdfa([
'type' => 'number_integer',
], 'http://schema.org/baseSalary', [
'value' => $testValue,
]);
// Test that the content attribute is not created.
$result = $this
->xpathContent($this
->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this
->assertEmpty($result);
}