Creates a random content type and node and ensures the default mapping for the node is being used.
function testMappingDefinitionRandomContentType() {
$type = $this
->drupalCreateContentType();
$node = $this
->drupalCreateNode(array(
'type' => $type->type,
));
$expected_mapping = array(
'rdftype' => array(
'sioc:Item',
'foaf:Document',
),
'title' => array(
'predicates' => array(
'dc:title',
),
),
'body' => array(
'predicates' => array(
'content:encoded',
),
),
'created' => array(
'predicates' => array(
'dc:date',
'dc:created',
),
'callback' => 'date_iso8601',
'datatype' => 'xsd:dateTime',
),
);
$node = node_load($node->nid);
foreach ($expected_mapping as $key => $mapping) {
$this
->assertEqual($node->rdf_mapping[$key], $mapping, format_string('Expected mapping found for @key.', array(
'@key' => $key,
)));
}
}