RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes

7 rdf.test RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes()
8 rdf.test RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes()

Creates a random term and ensures the right RDFa markup is used.

File

modules/rdf/rdf.test, line 396
Tests for rdf.module.

Code

function testTaxonomyTermRdfaAttributes() {
  $vocabulary = $this->createVocabulary();
  $term = $this->createTerm($vocabulary);

  // Views the term and checks that the RDFa markup is correct.
  $this->drupalGet('taxonomy/term/' . $term->tid);
  $term_url = url('taxonomy/term/' . $term->tid);
  $term_name = $term->name;
  $term_rdfa_meta = $this->xpath('//meta[@typeof="skos:Concept" and @about=:term-url and contains(@property, "rdfs:label") and contains(@property, "skos:prefLabel") and @content=:term-name]', array(
    ':term-url' => $term_url, 
    ':term-name' => $term_name,
  ));
  $this->assertTrue(!empty($term_rdfa_meta), t('RDFa markup found on term page.'));
}
Login or register to post comments