You are here

function SchemaorgNamespaceTestCase::testSchemaorgNamespace in Schema.org 7

Test getting RDF namesapces.

File

./schemaorg.test, line 27
Tests for schemaorg.module.

Class

SchemaorgNamespaceTestCase
Tests for schema.org namespaces declaration.

Code

function testSchemaorgNamespace() {

  // Get all RDF namespaces.
  $ns = rdf_get_namespaces();
  $this
    ->assertEqual($ns['schema'], 'http://schema.org/', t('Schema.org namespace is returned by rdf_get_namespaces().'));

  // Fetches the front page and extracts XML namespaces.
  $this
    ->drupalGet('');
  $xml = new SimpleXMLElement($this->content);
  $ns = $xml
    ->getDocNamespaces();
  $this
    ->assertEqual($ns['schema'], 'http://schema.org/', t('Schema.org namespace is present in the HTML document.'));
}