From 1fbd57f8101fdaa452fc71c7e54c41e8ff9df90a Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 1 Mar 2013 17:27:42 -0800 Subject: [PATCH] Needed to add this file too --- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index e2235fd1c5..09026939af 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -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). -- 2.25.1