1 taxonomy.test | TaxonomyTermIndexTestCase::testTaxonomyTermHierarchyBreadcrumbs() |
Tests that there is a link to the parent term on the child term page.
File
- core/
modules/ taxonomy/ tests/ taxonomy.test, line 1335 - Tests for taxonomy.module.
Class
- TaxonomyTermIndexTestCase
- Tests the hook implementations that maintain the taxonomy index.
Code
function testTaxonomyTermHierarchyBreadcrumbs() {
// Create two taxonomy terms and set term2 as the parent of term1.
$term1 = $this->createTerm($this->vocabulary);
$term2 = $this->createTerm($this->vocabulary);
$term1->parent = array($term2->tid);
taxonomy_term_save($term1);
// Verify that the page breadcrumbs include a link to the parent term.
$this->backdropGet('taxonomy/term/' . $term1->tid);
$this->assertRaw(l($term2->name, 'taxonomy/term/' . $term2->tid), 'Parent term link is displayed when viewing the node.');
}