public function RdfaAttributesTest::testDatatypeCallbackWithConverter in Drupal 9
Same name and namespace in other branches
- 8 core/modules/rdf/tests/src/Kernel/RdfaAttributesTest.php \Drupal\Tests\rdf\Kernel\RdfaAttributesTest::testDatatypeCallbackWithConverter()
- 10 core/modules/rdf/tests/src/Kernel/RdfaAttributesTest.php \Drupal\Tests\rdf\Kernel\RdfaAttributesTest::testDatatypeCallbackWithConverter()
Tests attribute creation for mappings which use data converters.
File
- core/
modules/ rdf/ tests/ src/ Kernel/ RdfaAttributesTest.php, line 79
Class
- RdfaAttributesTest
- Tests RDFa attribute generation from RDF mapping.
Namespace
Drupal\Tests\rdf\KernelCode
public function testDatatypeCallbackWithConverter() {
$properties = [
'schema:interactionCount',
];
$data = "23";
$content = "UserComments:23";
$mapping = [
'properties' => $properties,
'datatype_callback' => [
'callable' => 'Drupal\\rdf\\SchemaOrgDataConverter::interactionCount',
'arguments' => [
'interaction_type' => 'UserComments',
],
],
];
$expected_attributes = [
'property' => $properties,
'content' => $content,
];
$this
->_testAttributes($expected_attributes, $mapping, $data);
}