You are here

function error_test_generate_warnings in SimpleTest 7

Menu callback; generate warnings to test the error handler.

1 string reference to 'error_test_generate_warnings'
error_test_menu in tests/error_test.module
Implement hook_menu().

File

tests/error_test.module, line 39

Code

function error_test_generate_warnings($collect_errors = FALSE) {

  // Tell Drupal error reporter to send errors to Simpletest or not.
  define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);

  // This will generate a notice.
  $monkey_love = $bananas;

  // This will generate a warning.
  $awesomely_big = 1 / 0;

  // This will generate a user error.
  trigger_error("Drupal is awesome", E_USER_WARNING);
  return "";
}