You are here

function simpletest_help in Drupal 8

Same name and namespace in other branches
  1. 7 modules/simpletest/simpletest.module \simpletest_help()

Implements hook_help().

File

core/modules/simpletest/simpletest.module, line 28
Provides testing functionality.

Code

function simpletest_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.simpletest':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Testing module provides a framework for running automated tests. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. For more information, see the <a href=":simpletest">online documentation for the Testing module</a>.', [
        ':simpletest' => 'https://www.drupal.org/documentation/modules/simpletest',
      ]) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Running tests') . '</dt>';
      $output .= '<dd><p>' . t('Visit the <a href=":admin-simpletest">Testing page</a> to display a list of available tests. For comprehensive testing, select <em>all</em> tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.', [
        ':admin-simpletest' => Url::fromRoute('simpletest.test_form')
          ->toString(),
      ]) . '</p>';
      $output .= '<p>' . t('After the tests run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that the test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were failures or exceptions, the results will be expanded to show details, and the tests that had failures or exceptions will be indicated in red or pink rows. You can then use these results to refine your code and tests, until all tests pass.') . '</p></dd>';
      $output .= '</dl>';
      return $output;
    case 'simpletest.test_form':
      $output = t('Select the test(s) or test group(s) you would like to run, and click <em>Run tests</em>.');
      return $output;
  }
}