Creates a content type and a node of type test_bundle_hook_install and tests whether the RDF mapping defined in rdf_test.install is used.
function testMappingDefinitionTestBundleInstall() {
$this
->drupalCreateContentType(array(
'type' => 'test_bundle_hook_install',
));
$node = $this
->drupalCreateNode(array(
'type' => 'test_bundle_hook_install',
));
$expected_mapping = array(
'rdftype' => array(
'foo:mapping_install1',
'bar:mapping_install2',
),
'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,
)));
}
}