simpletest.api.php 1.55 KB
Newer Older
1 2 3 4 5 6 7
<?php

/**
 * @file
 * Hooks provided by the SimpleTest module.
 */

8 9 10 11 12 13 14 15 16 17 18 19
/**
 * Global variable that holds information about the tests being run.
 *
 * An array, with the following keys:
 *  - 'test_run_id': the ID of the test being run, in the form 'simpletest_%"
 *  - 'in_child_site': TRUE if the current request is a cURL request from
 *     the parent site.
 *
 * @var array
 */
global $drupal_test_info;

20 21 22 23 24
/**
 * @addtogroup hooks
 * @{
 */

25 26 27 28 29 30 31 32 33 34
/**
 * Alter the list of tests.
 *
 * @param $groups
 *   A two dimension array, the first key is the test group (as defined in
 *   getInfo) the second is the name of the class and the value is the return
 *   value of the getInfo method.
 */
function hook_simpletest_alter(&$groups) {
  // An alternative session handler module would not want to run the original
35
  // Session HTTPS handling test because it checks the sessions table in the
36 37 38 39
  // database.
  unset($groups['Session']['testHttpsSession']);
}

40 41
/**
 * A test group has started.
42
 *
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
 * This hook is called just once at the beginning of a test group.
 */
function hook_test_group_started() {
}

/**
 * A test group has finished.
 *
 * This hook is called just once at the end of a test group.
 */
function hook_test_group_finished() {
}

/**
 * An individual test has finished.
58
 *
59 60 61
 * This hook is called when an individual test has finished.
 *
 * @param
62 63
 *   $results The results of the test as gathered by
 *   \Drupal\simpletest\WebTestBase.
64
 *
65
 * @see \Drupal\simpletest\WebTestBase->results()
66 67 68 69 70 71 72 73
 */
function hook_test_finished($results) {
}


/**
 * @} End of "addtogroup hooks".
 */