diff options
Diffstat (limited to 'modules/simpletest/simpletest.install')
-rw-r--r-- | modules/simpletest/simpletest.install | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/simpletest/simpletest.install b/modules/simpletest/simpletest.install index 1370c20cf..2aa13e926 100644 --- a/modules/simpletest/simpletest.install +++ b/modules/simpletest/simpletest.install @@ -107,24 +107,24 @@ function simpletest_requirements($phase) { $t = get_t(); $has_curl = function_exists('curl_init'); + $has_domdocument = class_exists('DOMDocument'); - switch ($phase) { - case 'runtime': - $requirements['simpletest'] = array( - 'title' => $t('cURL'), - 'value' => $has_curl ? $t('Enabled') : $t('Not found'), - 'severity' => $has_curl ? REQUIREMENT_OK : REQUIREMENT_ERROR, - ); - break; - case 'install': - if (!$has_curl) { - $requirements['simpletest'] = array( - 'title' => $t('cURL'), - 'severity' => REQUIREMENT_ERROR, - 'description' => $t('Simpletest could not be installed because the PHP <a href="!curl_url">cURL</a> library is not available.', array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')), - ); - } - break; + $requirements['curl'] = array( + 'title' => $t('cURL'), + 'value' => $has_curl ? $t('Enabled') : $t('Not found'), + ); + if (!$has_curl) { + $requirements['curl']['severity'] = REQUIREMENT_ERROR; + $requirements['curl']['description'] = $t('Simpletest could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/en/curl.setup.php')); + } + + $requirements['php_domdocument'] = array( + 'title' => $t('PHP DOMDocument class'), + 'value' => $has_domdocument ? $t('Enabled') : $t('Not found'), + ); + if (!$has_domdocument) { + $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR; + $requirements['php_domdocument']['description'] =t('SimpleTest requires the DOMDocument class to be available. Please check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php'))); } return $requirements; |