You are here

protected function AcquiaPurgeDiagnostics::initializeTestFunctionsList in Acquia Purge 7

Gather test function names from hook_acquia_purge_diagnostics().

1 call to AcquiaPurgeDiagnostics::initializeTestFunctionsList()
AcquiaPurgeDiagnostics::initializeTestResults in lib/AcquiaPurgeDiagnostics.php
Execute the test functions and gather the results.

File

lib/AcquiaPurgeDiagnostics.php, line 89
Contains AcquiaPurgeExecutorsService.

Class

AcquiaPurgeDiagnostics
Provides access to the diagnostic tests.

Code

protected function initializeTestFunctionsList() {
  if (empty($this->functions)) {
    $cid = ACQUIA_PURGE_CID_PREFIX . '_diagnostics';
    if ($cache = cache_get($cid)) {
      $this->functions = $cache->data['f'];
      $this->includes = $cache->data['i'];
    }
    else {
      foreach (module_implements('acquia_purge_diagnostics') as $module) {
        $hook = $module . '_acquia_purge_diagnostics';
        foreach ($hook() as $i => $value) {
          if ($i === 'module_load_include') {
            $this->includes[] = $value;
          }
          else {
            $this->functions[] = $value;
          }
        }
      }
      cache_set($cid, array(
        'i' => $this->includes,
        'f' => $this->functions,
      ));
    }
  }
}