Webtest fixes
[civicrm-core.git] / tests / phpunit / WebTest / Import / MatchExternalIdTest.php
index 1aa0db57ed5ed1f09d4733a1b41c9302f6d8da45..e8a1df5f26c696d3f3cd8d5d33c74abd81b4ef5e 100644 (file)
 */
 
 require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Import_MatchExternalIdTest
+ */
 class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
 
   protected function setUp() {
@@ -74,6 +78,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
   /*
       *  Helper function to provide data for contribution  import for Individual.
       */
+  /**
+   * @return array
+   */
   function _contributionIndividualCSVData() {
     $firstName1  = substr(sha1(rand()), 0, 7);
     $lastName1   = substr(sha1(rand()), 0, 7);
@@ -122,6 +129,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
   /*
      *  Helper function to provide data for membership import for Individual.
      */
+  /**
+   * @return array
+   */
   function _memberIndividualCSVData() {
     $memTypeParams = $this->webtestAddMembershipType();
 
@@ -169,6 +179,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
   /*
      *  Helper function to provide data for participant import for Individual.
      */
+  /**
+   * @return array
+   */
   function _participantIndividualCSVData() {
     $eventInfo = $this->_addNewEvent();
 
@@ -229,6 +242,13 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
      *
      * @return int external id
      */
+  /**
+   * @param $firstName
+   * @param $lastName
+   * @param $externalId
+   *
+   * @return mixed
+   */
   function _addContact($firstName, $lastName, $externalId) {
     $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
 
@@ -256,12 +276,17 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
      *
      * @return array $params event details of newly created event
      */
+  /**
+   * @param array $params
+   *
+   * @return array
+   */
   function _addNewEvent($params = array(
     )) {
     if (empty($params)) {
 
-      // We need a payment processor
-      $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
+      // Use default payment processor
+      $processorName = 'Test Processor';
       $this->webtestAddPaymentProcessor($processorName);
 
       // create an event
@@ -323,10 +348,10 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     $this->click("link=Online Registration");
     $this->waitForElementPresent("_qf_Registration_upload-bottom");
 
-    $this->check("is_online_registration");
+    $this->click("is_online_registration");
     $this->assertChecked("is_online_registration");
 
-    $this->fillRichTextField("intro_text", "Fill in all the fields below and click Continue.");
+    $this->fillRichTextField("intro_text", "Fill in all the fields below and click Continue.", 'CKEditor', TRUE);
 
     // enable confirmation email
     $this->click("CIVICRM_QFID_1_is_email_confirm");