You are here

function DrupalSolrQueryBreadcrumbTests::testBreadcrumbLinks in Apache Solr Search 5

File

tests/solr_base_query_breadcrumb.test, line 46

Class

DrupalSolrQueryBreadcrumbTests

Code

function testBreadcrumbLinks() {
  $link_part = '<a ';
  $result = TRUE;
  for ($i = 0; $i + 1 < count($this->breadcrumb); ++$i) {
    $result &= $this
      ->assertTrue(strpos($this->breadcrumb[$i], $link_part) !== FALSE, 'Breadcrumb items other than the ' . 'last should be links. But ' . ($i + 1) . 'th item is: ' . str_replace('%', '%%', $this->breadcrumb[$i]) . (is_array($this->breadcrumb[$i]) ? ' true' : ' false'));
  }
  $result &= $this
    ->assertTrue(strpos($this->breadcrumb[count($this->breadcrumb) - 1], $link_part) === FALSE, 'Last breadcrumb item should not be a link.');
  return $result;
}