You are here

protected function AcquiaPurgeDiagnostics::initializeTestResults in Acquia Purge 7

Execute the test functions and gather the results.

1 call to AcquiaPurgeDiagnostics::initializeTestResults()
AcquiaPurgeDiagnostics::get in lib/AcquiaPurgeDiagnostics.php
Get the test results.

File

lib/AcquiaPurgeDiagnostics.php, line 116
Contains AcquiaPurgeExecutorsService.

Class

AcquiaPurgeDiagnostics
Provides access to the diagnostic tests.

Code

protected function initializeTestResults() {
  if (is_null($this->results)) {
    $this
      ->initializeTestFunctionsList();
    $this->results = array();

    // Firstly, load all the includes that have been collected earlier.
    foreach ($this->includes as $include) {
      call_user_func_array('module_load_include', $include);
    }

    // Iterate each test function and normalize and enrich the returning data.
    $t = get_t();
    $r = array();
    foreach ($this->functions as $f) {
      $r[$f] = $f($t, $this->service);
      $r[$f]['name'] = isset($r[$f]['title']) ? $r[$f]['title'] : $f;
      $r[$f]['description'] = isset($r[$f]['description']) ? $r[$f]['description'] : NULL;
      $r[$f]['description_plain'] = strip_tags($r[$f]['description']);
      $r[$f]['severity'] = isset($r[$f]['severity']) ? $r[$f]['severity'] : ACQUIA_PURGE_SEVLEVEL_INFO;
      $r[$f]['value_plain'] = isset($r[$f]['value_plain']) ? $r[$f]['value_plain'] : $r[$f]['value'];
      $r[$f]['value'] = $t('<b>@title</b><br />@value', array(
        '@title' => $r[$f]['title'],
        '@value' => $r[$f]['value'],
      ));
      $r[$f]['title'] = $t('Acquia Purge');
    }
    $this->results = $r;
  }
}