You are here

function StatisticsProBaseTestCase::getTypeName in Statistics Pro 6.2

Same name and namespace in other branches
  1. 6 tests/statspro.test \StatisticsProBaseTestCase::getTypeName()
1 call to StatisticsProBaseTestCase::getTypeName()
StatisticsProBaseTestCase::completeTestAggregatedData in tests/statspro.test

File

tests/statspro.test, line 170
Functionality tests for Statistics Pro.

Class

StatisticsProBaseTestCase
Base class for Statistics Pro tests.

Code

function getTypeName($type) {
  if (!$this->type_names) {
    $this->type_names = array(
      'pi' => t('page impressions'),
      'upi' => t('authenticated users page impressions'),
      'error' => t('errors'),
      'uerror' => t('authenticated users errors'),
      'warning' => t('warnings'),
      'uwarning' => t('authenticated users warnings'),
      'users' => t('total number of users'),
      'terms' => t('total number of terms'),
      'nodes' => t('total number of nodes'),
      'node_types' => t('total number of node types'),
      'comments' => t('total number of comments'),
      'aliases' => t('total number of aliases'),
      'sessions' => t('total number of sessions'),
      'modules' => t('total number of modules'),
      'emergency' => t('emergencies'),
      'uemergency' => t('authenticated users emergencies'),
      'alert' => t('alerts'),
      'ualert' => t('authenticated users alerts'),
      'critical' => t('critical conditions'),
      'ucritical' => t('authenticated users critical conditions'),
    );
  }
  $defined = isset($this->type_names[$type]);
  if ($defined) {
    return $this->type_names[$type];
  }
  else {
    $this
      ->assertTrue($defined, t("Type '%type' not identified.", array(
      '%type' => $type,
    )), t('Get type name from type.'));
    return '';
  }
}