public function NumberFieldRdfaTest::testFloatFormatter in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php \Drupal\rdf\Tests\Field\NumberFieldRdfaTest::testFloatFormatter()
Tests the float formatter.
File
- core/
modules/ rdf/ src/ Tests/ Field/ NumberFieldRdfaTest.php, line 62 - Contains \Drupal\rdf\Tests\Field\NumberFieldRdfaTest.
Class
- NumberFieldRdfaTest
- Tests RDFa output by number field formatters.
Namespace
Drupal\rdf\Tests\FieldCode
public function testFloatFormatter() {
$this->fieldType = 'float';
$testValue = 3.33;
$this
->createTestField();
$this
->createTestEntity($testValue);
$this
->assertFormatterRdfa(array(
'type' => 'number_unformatted',
), 'http://schema.org/baseSalary', array(
'value' => $testValue,
));
// Test that the content attribute is not created.
$result = $this
->xpathContent($this
->getRawContent(), '//div[contains(@class, "field__items") and @content]');
$this
->assertFalse($result);
}