Heine

  • drupal
  • drupal core commits
  • about
  • contact
Home

Commit 212768 by dries

- Patch #407294 by Litrik: provide hooks to allow other modules to listen to SimpleTest results. Java-lamp, here I come!

<?php
// $Id$

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

/**
 * @addtogroup hooks
 * @{
 */

/**
 * A test group has started.
 *
 * This hook is called just once at the beginning of a test group.
 *
 * @return
 *   None.
 *
 */
function hook_test_group_started() {
}

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

/**
 * An individual test has finished.
 *
 * This hook is called when an individual test has finished.
 *
 * @param
 *   $results The results of the test as gathered by DrupalWebTestCase.
 *
 * @return
 *   None.
 *
 * @see DrupalWebTestCase->results
 */
function hook_test_finished($results) {
}


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

--- modules/simpletest/simpletest.module        2009/05/17 08:46:48     1.43
+++ modules/simpletest/simpletest.module        2009/05/17 10:49:40     1.44
@@ -127,6 +127,9 @@
     'init_message' => t('Processing test @num of @max - %test.', array('%test' => $info['name'], '@num' => '1', '@max' => count($test_list))),
   );
   batch_set($batch);
+  
+  module_invoke_all('test_group_started');
+  
   // Normally, the forms portion of the batch API takes care of calling
   // batch_process(), but in the process it saves the whole $form into the
   // database (which is huge for the test selection form).
@@ -164,6 +167,8 @@
   $size = count($test_list);
   $info = $test->getInfo();
 
+  module_invoke_all('test_finished', $test->results);
+
   // Gather results and compose the report.
   $test_results[$test_class] = $test->results;
   foreach ($test_results[$test_class] as $key => $value) {
@@ -195,6 +200,7 @@
   else {
     drupal_set_message(t('The tests did not successfully finish.'), 'error');
   }
+  module_invoke_all('test_group_finished');
 }
 
 /**

No votes yet
  • Drupal Core
  • Download patch

Recent posts

  • Drupal 6: $base_path doesn't always point to the frontpage
  • XNA SoundEffect ContentLoadException
  • A new form element in Drupal core
  • The backstabbing March-Hare
  • Drupal HEAD and HTTP 500 errors on IIS 7

All-time popular content

  • Update UID 1 password via JS
  • Keeping an eye on Drupal core
  • Subversion on Strato V-PowerServer
  • A new form element in Drupal core
  • Access denied - Are you sure?
more

Tags

Captcha Coding Drupal FAPI IIS Let's hope it doesn't become popular Performance PHP Planet Drupal Quiz Security V-PowerServer
more tags
  • drupal
  • drupal core commits
  • about
  • contact

Copyright © 2009 by Heine Deelstra. All rights reserved.