Merge pull request #4903 from colemanw/INFRA-132
[civicrm-core.git] / tests / phpunit / WebTest / Event / ParticipantCountTest.php
index 93bd04debe493be918dc317162b01520c60c4464..194f0968d9b95769f9071364cf99714a3704d7da 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  function testParticipantCountWithFeelevel() {
+  public function testParticipantCountWithFeelevel() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -73,7 +73,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
 
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jones'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
     $this->type('email-Primary', $email);
 
     // fill billing details and register
@@ -90,7 +90,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->click("xpath=//input[@class='crm-form-radio']");
     $email = 'jane_' . substr(sha1(rand()), 0, 5) . '@example.org';
     $this->type('first_name', 'Mary');
-    $this->type('last_name', 'Jones'. substr(sha1(rand()), 0, 5));
+    $this->type('last_name', 'Jones' . substr(sha1(rand()), 0, 5));
     $this->type('email-Primary', $email);
 
     // fill billing details and register
@@ -106,10 +106,10 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // verify number of registered participants
-    $this->assertTrue($this->isTextPresent('2 Results'));
+    $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td", '2 Results');
   }
 
-  function testParticipantCountWithPriceset() {
+  public function testParticipantCountWithPriceset() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -301,7 +301,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
    * @param $setTitle
    * @param string $financialType
    */
-  function _testAddSet($setTitle, $financialType = 'Event Fee') {
+  public function _testAddSet($setTitle, $financialType = 'Event Fee') {
     $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
 
     // Enter Priceset fields (Title, Used For ...)
@@ -317,7 +317,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
   /**
    * @param $options
    */
-  function _testAddMultipleChoiceOptions($options) {
+  public function _testAddMultipleChoiceOptions($options) {
     foreach ($options as $oIndex => $oValue) {
       $this->type("option_label_{$oIndex}", $oValue['label']);
       $this->type("option_amount_{$oIndex}", $oValue['amount']);
@@ -335,7 +335,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
    *
    * @return string
    */
-  function _testAddEvent($params) {
+  public function _testAddEvent($params) {
     $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom');
 
     $this->select('event_type_id', "value={$params['event_type_id']}");
@@ -412,7 +412,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
   /**
    * @param array $participant
    */
-  function _testRegisterWithBillingInfo($participant = array()) {
+  public function _testRegisterWithBillingInfo($participant = array()) {
     $this->waitForElementPresent("credit_card_type");
     $this->select('credit_card_type', 'value=Visa');
     $this->type('credit_card_number', '4111111111111111');
@@ -437,11 +437,11 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param $eventParams
+   * @param array $eventParams
    * @param $participants
    * @param $priceFieldOptionCounts
    */
-  function _testPricesetDetailsCustomSearch($eventParams, $participants, $priceFieldOptionCounts) {
+  public function _testPricesetDetailsCustomSearch($eventParams, $participants, $priceFieldOptionCounts) {
     $this->openCiviPage('contact/search/custom', 'csid=9&reset=1');
 
     $this->select('event_id', 'label=' . $eventParams['title']);
@@ -467,4 +467,3 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     }
   }
 }
-