diff options
Diffstat (limited to 'modules/rdf/tests')
-rw-r--r-- | modules/rdf/tests/rdf_test.info | 9 | ||||
-rw-r--r-- | modules/rdf/tests/rdf_test.install | 26 | ||||
-rw-r--r-- | modules/rdf/tests/rdf_test.module | 44 |
3 files changed, 79 insertions, 0 deletions
diff --git a/modules/rdf/tests/rdf_test.info b/modules/rdf/tests/rdf_test.info new file mode 100644 index 000000000..72f6518ec --- /dev/null +++ b/modules/rdf/tests/rdf_test.info @@ -0,0 +1,9 @@ +; $Id$ +name = "RDF module tests" +description = "Support module for RDF module testing." +package = Testing +version = VERSION +core = 7.x +files[] = rdf_test.install +files[] = rdf_test.module +hidden = TRUE diff --git a/modules/rdf/tests/rdf_test.install b/modules/rdf/tests/rdf_test.install new file mode 100644 index 000000000..ba7086ddd --- /dev/null +++ b/modules/rdf/tests/rdf_test.install @@ -0,0 +1,26 @@ +<?php +// $Id$ + +/** + * @file + * Install, update and uninstall functions for the rdf module. + */ + +/** + * Implement hook_install(). + */ +function rdf_test_install() { + $rdf_mappings = array( + array( + 'type' => 'node', + 'bundle' => 'test_bundle_hook_install', + 'mapping' => array( + 'rdftype' => array('foo:mapping_install1', 'bar:mapping_install2'), + ), + ), + ); + + foreach ($rdf_mappings as $rdf_mapping) { + rdf_save_mapping($rdf_mapping); + } +} diff --git a/modules/rdf/tests/rdf_test.module b/modules/rdf/tests/rdf_test.module new file mode 100644 index 000000000..72959705f --- /dev/null +++ b/modules/rdf/tests/rdf_test.module @@ -0,0 +1,44 @@ +<?php +// $Id$ + +/** + * @file + * Dummy module implementing RDF related hooks to test API interaction with + * the RDF module. + */ + +/** + * Implementation of hook_rdf_mapping(). + */ +function rdf_test_rdf_mapping() { + return array( + 0 => array( + 'type' => 'test_entity', + 'bundle' => 'test_bundle', + 'mapping' => array( + 'rdftype' => array('sioc:Post'), + 'title' => array( + 'predicates' => array('dc:title'), + ), + 'created' => array( + 'predicates' => array('dc:created'), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'uid' => array( + 'predicates' => array('sioc:has_creator', 'dc:creator'), + ), + 'foobar' => array( + 'predicates' => array('foo:bar'), + ), + ), + ), + 1 => array( + 'type' => 'node', + 'bundle' => 'blog', + 'mapping' => array( + 'rdftype' => array('sioct:Weblog'), + ) + ), + ); +} |