Needed to add this file too
authorColeman Watts <coleman@civicrm.org>
Sat, 2 Mar 2013 01:27:42 +0000 (17:27 -0800)
committerColeman Watts <coleman@civicrm.org>
Sat, 2 Mar 2013 01:27:42 +0000 (17:27 -0800)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php

index e2235fd1c5578013f012044308d0cf07027245aa..09026939aff22eecda4868762372a36fdfe65210 100644 (file)
@@ -214,6 +214,27 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     return $_config_backend[$field];
   }
 
+  /**
+   * Ensures the required CiviCRM components are enabled
+   */
+  function enableComponents($components) {
+    $this->openCiviPage("admin/setting/component", "reset=1", "_qf_Component_next-bottom");
+    $enabledComponents = $this->getSelectOptions("enableComponents-t");
+    $added = FALSE;
+    foreach ((array) $components as $comp) {
+      if (!in_array($comp, $enabledComponents)) {
+        $this->click("//option[@value='$comp']");
+        $this->click("add");
+        $added = TRUE;
+      }
+    }
+    if ($added) {
+      $this->click("_qf_Component_next-bottom");
+      $this->waitForPageToLoad($this->getTimeoutMsec());
+      $this->assertElementContainsText("crm-notification-container", "Saved");
+    }
+  }
+
   /**
    * Add a contact with the given first and last names and either a given email
    * (when specified), a random email (when true) or no email (when unspecified or null).