Merge branch '4.5' into 4.6
[civicrm-core.git] / tests / phpunit / WebTest / Event / AddParticipationTest.php
index 0a52cfa2d8fcdaa3b13c05b5520e9c93affd4af4..5ac33ac5bf023d03860bbc4605da96f758990f38 100644 (file)
@@ -22,7 +22,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
 
@@ -93,9 +93,9 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     // Is status message correct?
     $this->checkCRMAlert("Event registration for $displayName has been added");
 
-    $this->waitForElementPresent("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
     //click through to the participant view screen
-    $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
+    $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
 
     $this->webtestVerifyTabularData(
       array(
@@ -282,9 +282,9 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     // Is status message correct?
     $this->checkCRMAlert("Event registration for $displayName has been added");
 
-    $this->waitForElementPresent("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
     //click through to the participant view screen
-    $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
+    $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom');
 
     $this->webtestVerifyTabularData(
       array(
@@ -357,37 +357,71 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
 
     $customSets = array(
       array(
-    'entity' => 'ParticipantEventName',
-    'subEntity' => 'Fall Fundraiser Dinner',
-        'triggerElement' => array('name' => "event_id", 'type' => "select2")),
-      array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee', 'triggerElement' => array('name' => 'role_id', 'type' => "select"))
+        'entity' => 'ParticipantEventName',
+        'subEntity' => 'Fall Fundraiser Dinner',
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select2",
+        ),
+      ),
+      array(
+        'entity' => 'ParticipantRole',
+        'subEntity' => 'Attendee',
+        'triggerElement' => array(
+          'name' => 'role_id',
+          'type' => "select",
+        ),
+      ),
     );
     $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
     $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE);
   }
 
-  /*
+  /**
    * Webtest for CRM-10983
-   *
    */
   public function testCheckDuplicateCustomDataLoad() {
     $this->webtestLogin();
 
     $customSets = array(
       array(
-    'entity' => 'ParticipantEventType',
-    'subEntity' => '- Any -',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")),
+        'entity' => 'ParticipantEventType',
+        'subEntity' => '- Any -',
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
+      ),
       array(
-    'entity' => 'ParticipantEventName',
-    'subEntity' => '- Any -',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")),
+        'entity' => 'ParticipantEventName',
+        'subEntity' => '- Any -',
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
+      ),
       array(
-    'entity' => 'ParticipantEventName',
-    'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
-        'triggerElement' => array('name' => "event_id", 'type' => "select")),
-      array('entity' => 'ParticipantRole', 'subEntity' => '- Any -', 'triggerElement' => array('type' => "checkbox")),
-      array('entity' => 'ParticipantRole', 'subEntity' => 'Volunteer', 'triggerElement' => array('type' => "checkbox"))
+        'entity' => 'ParticipantEventName',
+        'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
+        'triggerElement' => array(
+          'name' => "event_id",
+          'type' => "select",
+        ),
+      ),
+      array(
+        'entity' => 'ParticipantRole',
+        'subEntity' => '- Any -',
+        'triggerElement' => array(
+          'type' => "checkbox",
+        ),
+      ),
+      array(
+        'entity' => 'ParticipantRole',
+        'subEntity' => 'Volunteer',
+        'triggerElement' => array(
+          'type' => "checkbox",
+        ),
+      ),
     );
 
     $return = $this->addCustomGroupField($customSets);
@@ -410,14 +444,11 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param string $firstName
-   * @param string $lastName
    * @param int $processorId
    */
   public function _fillParticipantDetails($processorId) {
     $contact = $this->createDialogContact();
 
-    $this->select('payment_processor_id', "value={$processorId}");
     $event_id = $this->getAttribute("xpath=//*[@id='event_id']@value");
     //check if it is the selected event
     $this->assertEquals($event_id, 3);
@@ -426,4 +457,5 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     $this->webtestAddBillingDetails();
     return $contact;
   }
+
 }