summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/common.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 21:41:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 21:41:09 +0000
commitcca6d06c01e377975e8625b6743d069e08b38684 (patch)
tree77eda58d8cbf06a52125399f5c586c30988a902c /modules/simpletest/tests/common.test
parent164b9a3268e20c7e9ee792009ea5ee803f592bd4 (diff)
downloadbrdo-cca6d06c01e377975e8625b6743d069e08b38684.tar.gz
brdo-cca6d06c01e377975e8625b6743d069e08b38684.tar.bz2
#721082 by scor, linclark: Fixed Prevent conflicting namespaces and move hook_rdf_namespaces() invocation into rdf.module.
Diffstat (limited to 'modules/simpletest/tests/common.test')
-rw-r--r--modules/simpletest/tests/common.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 9eaefe168..cdec4ed98 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -1891,3 +1891,35 @@ class DrupalJSONTest extends DrupalUnitTestCase {
$this->assertIdentical($source, $json_decoded, t('Encoding structured data to JSON and decoding back results in the original data.'));
}
}
+
+/**
+ * Tests for RDF namespaces XML serialization.
+ */
+class DrupalGetRdfNamespacesTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'RDF namespaces XML serialization tests',
+ 'description' => 'Confirm that the serialization of RDF namespaces via drupal_get_rdf_namespaces() is output and parsed correctly in the XHTML document.',
+ 'group' => 'System',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('rdf', 'rdf_test');
+ }
+
+ /**
+ * Test RDF namespaces.
+ */
+ function testGetRdfNamespaces() {
+ // Fetches the front page and extracts XML namespaces.
+ $this->drupalGet('');
+ $xml = new SimpleXMLElement($this->content);
+ $ns = $xml->getDocNamespaces();
+
+ $this->assertEqual($ns['owl'], 'http://www.w3.org/2002/07/owl#', t('A prefix declared once is displayed.'));
+ $this->assertEqual($ns['foaf'], 'http://xmlns.com/foaf/0.1/', t('The same prefix declared in several implementations of hook_rdf_namespaces() is valid as long as all the namespaces are the same.'));
+ $this->assertEqual($ns['foaf1'], 'http://xmlns.com/foaf/0.1/', t('Two prefixes can be assigned the same namespace.'));
+ $this->assertTrue(!isset($ns['dc']), t('A prefix with conflicting namespaces is discarded.'));
+ }
+}