Index: modules/simpletest/simpletest.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.install,v
retrieving revision 1.1
diff -u -p -r1.1 simpletest.install
--- modules/simpletest/simpletest.install	20 Apr 2008 18:23:29 -0000	1.1
+++ modules/simpletest/simpletest.install	26 Apr 2008 22:19:32 -0000
@@ -96,3 +96,40 @@ function simpletest_uninstall() {
   variable_del('simpletest_httpauth_pass');
   variable_del('simpletest_devel');
 }
+
+/**
+ * Check that the IMAP extension exists for PHP.
+ */
+function simpletest_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+  
+  $has_curl = function_exists('curl_init');
+  
+  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_OK,
+        );
+      }
+      else {
+        $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;
+  }
+  
+  return $requirements;
+}
