You are here

function DrupalSolrQueryBreadcrumbTests::testBreadcrumbCount in Apache Solr Search 5

File

tests/solr_base_query_breadcrumb.test, line 28

Class

DrupalSolrQueryBreadcrumbTests

Code

function testBreadcrumbCount() {
  $query_count = count(explode(' ', $this->query_string));
  $menu_active_count = count($this->menu_active_breadcrumb);
  $expected_breadcrumb_count = $menu_active_count + $query_count;
  $query_breadcrumb_count = count($this->breadcrumb);
  $message = 'The number of items in the breadcrumb (@breadcrumb_count) ' . 'should be equal to the number of items in $menu_active_breadcrumb ' . '(@menu_active_count) plus the number of words in $query ' . '(@query_count).';
  $vars = array(
    '@breadcrumb_count' => $query_breadcrumb_count,
    '@menu_active_count' => $menu_active_count,
    '@query_count' => $query_count,
  );
  return $this
    ->assertEqual($query_breadcrumb_count, $expected_breadcrumb_count, "'%s' " . t($message, $vars));
}