Make helper fn for enabling components
authorColeman Watts <coleman@civicrm.org>
Sat, 2 Mar 2013 01:23:37 +0000 (17:23 -0800)
committerColeman Watts <coleman@civicrm.org>
Sat, 2 Mar 2013 01:23:37 +0000 (17:23 -0800)
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php

index 8f6e795a78cb5b3ac9e8c2b54c840c3872eb3027..dbfc5fd4c72c49a54337950159880b7bdf0f2dbb 100644 (file)
@@ -66,17 +66,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->click("_qf_GroupContact_next");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    // Enable CiviCampaign module if necessary
-    $this->openCiviPage("admin/setting/component", "reset=1", "_qf_Component_next-bottom");
-    $enabledComponents = $this->getSelectOptions("enableComponents-t");
-    if (!in_array("CiviCampaign", $enabledComponents)) {
-      $this->addSelection("enableComponents-f", "label=CiviCampaign");
-      $this->click("//option[@value='CiviCampaign']");
-      $this->click("add");
-      $this->click("_qf_Component_next-bottom");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->assertElementContainsText("crm-notification-container", "Saved");
-    }
+    $this->enableComponents(array('CiviCampaign'));
 
     // add the required Drupal permission
     $permissions = array('edit-2-administer-civicampaign');