You are here

function simpletest_result_status_image in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 simpletest.pages.inc \simpletest_result_status_image()
  2. 7.2 simpletest.pages.inc \simpletest_result_status_image()

Get the appropriate image for the status.

Parameters

$status Status string, either: pass, fail, exception.:

Return value

HTML image or false.

1 call to simpletest_result_status_image()
simpletest_result_form in ./simpletest.pages.inc
Test results form for $test_id.

File

./simpletest.pages.inc, line 401
Page callbacks for simpletest module.

Code

function simpletest_result_status_image($status) {

  // $map does not use drupal_static() as its value never changes.
  static $map;
  if (!isset($map)) {
    $map = array(
      'pass' => theme('image', array(
        'path' => 'misc/watchdog-ok.png',
        'alt' => t('Pass'),
      )),
      'fail' => theme('image', array(
        'path' => 'misc/watchdog-error.png',
        'alt' => t('Fail'),
      )),
      'exception' => theme('image', array(
        'path' => 'misc/watchdog-warning.png',
        'alt' => t('Exception'),
      )),
      'debug' => theme('image', array(
        'path' => 'misc/watchdog-warning.png',
        'alt' => t('Debug'),
      )),
    );
  }
  if (isset($map[$status])) {
    return $map[$status];
  }
  return FALSE;
}