You are here

function sbp_test_make_output_page in Search by Page 7

Same name and namespace in other branches
  1. 6 tests/sbp_test.module \sbp_test_make_output_page()

Page callback function for path 'sbp_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.
1 string reference to 'sbp_test_make_output_page'
sbp_test_menu in tests/sbp_test.module
Implements hook_menu().

File

tests/sbp_test.module, line 304
Module file for Search by Page testing.

Code

function sbp_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', 'sbp_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>';
}