You are here

public function SearchByPageTesterTest::search_by_page_test_make_output_page in Search by Page 8

Page callback function for path 'search_by_page_test_output_page'.

This page intentionally does some things designed to screw up the Search by Page output:

  • Sets the page title.
  • Sets the breadcrumb.
  • Sets the active trail.
  • Prints some output instead of just returning output.

File

tests/src/Functional/SearchByPageTesterTest.php, line 465
General Functional Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Class

SearchByPageTesterTest
Base class for testing Search by Page.

Namespace

Drupal\Tests\search_by_page\Functional

Code

public function search_by_page_test_make_output_page() {
  drupal_set_title('wrong page title');
  print "wrong information printed";
  drupal_set_breadcrumb(array(
    l('wrong breadcrumb', '<front>'),
    l('wrong breadcrumb 2', 'search_by_page_test_pub_page'),
  ));
  $trail = menu_get_active_trail();
  $i = 1;
  foreach ($trail as $item) {
    $item['title'] = "wrong trail {$i}";
    $i++;
  }
  menu_set_active_trail($trail);
  return '<h2>' . t('Trees') . '</h2>' . '<ul>' . '<li>' . t('Apple') . '</li>' . '<li>' . t('Pear') . '</li>' . '</ul>';
}