simpletest.api.php

Hooks provided by the SimpleTest module.

File

drupal/core/modules/simpletest/simpletest.api.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the SimpleTest module.
  5. */
  6. /**
  7. * Global variable that holds information about the tests being run.
  8. *
  9. * An array, with the following keys:
  10. * - 'test_run_id': the ID of the test being run, in the form 'simpletest_%"
  11. * - 'in_child_site': TRUE if the current request is a cURL request from
  12. * the parent site.
  13. *
  14. * @var array
  15. */
  16. global $drupal_test_info;
  17. /**
  18. * @addtogroup hooks
  19. * @{
  20. */
  21. /**
  22. * Alter the list of tests.
  23. *
  24. * @param $groups
  25. * A two dimension array, the first key is the test group (as defined in
  26. * getInfo) the second is the name of the class and the value is the return
  27. * value of the getInfo method.
  28. */
  29. function hook_simpletest_alter(&$groups) {
  30. // An alternative session handler module would not want to run the original
  31. // Session HTTPS handling test because it checks the sessions table in the
  32. // database.
  33. unset($groups['Session']['testHttpsSession']);
  34. }
  35. /**
  36. * A test group has started.
  37. *
  38. * This hook is called just once at the beginning of a test group.
  39. */
  40. function hook_test_group_started() {
  41. }
  42. /**
  43. * A test group has finished.
  44. *
  45. * This hook is called just once at the end of a test group.
  46. */
  47. function hook_test_group_finished() {
  48. }
  49. /**
  50. * An individual test has finished.
  51. *
  52. * This hook is called when an individual test has finished.
  53. *
  54. * @param
  55. * $results The results of the test as gathered by Drupal\simpletest\WebTestBase.
  56. *
  57. * @see Drupal\simpletest\WebTestBase->results()
  58. */
  59. function hook_test_finished($results) {
  60. }
  61. /**
  62. * @} End of "addtogroup hooks".
  63. */

Functions

Namesort descending Description
hook_simpletest_alter Alter the list of tests.
hook_test_finished An individual test has finished.
hook_test_group_finished A test group has finished.
hook_test_group_started A test group has started.

Globals

Namesort descending Description
$drupal_test_info Global variable that holds information about the tests being run.