Webtests and CRM test fix
[civicrm-core.git] / tests / phpunit / WebTest / Contact / SearchbyDateFilterTest.php
index 54530b9eaae886d70236310a963fe7cf9796b2c4..d93e0211db5aa3f821bb2c33749b4dc6d0eeccd1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Contact_SearchbyDateFilterTest
+ */
 class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
@@ -32,9 +36,9 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
   }
 
   /*
-   * Function to test individual pane seperatly.
+   * test individual pane seperatly.
    */
-  function testAdvancedSearch() {
+  public function testAdvancedSearch() {
     $this->webtestLogin();
 
     // Get all default advance search panes.
@@ -57,7 +61,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
 
   }
 
-  function testIndividualSearchPage(){
+  public function testIndividualSearchPage(){
     $this->webtestLogin();
 
     $this->openCiviPage("contribute/search", "reset=1");
@@ -149,9 +153,12 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
   }
 
+  /**
+   * @param array $openedPanes
+   */
   function _checkOpenedPanes($openedPanes = array(
     )) {
-    if (!$this->isTextPresent('No matches found')) {
+    if (!$this->isTextPresent('None found.')) {
       $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header');
     }
 
@@ -168,6 +175,10 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
     }
   }
 
+  /**
+   * @param $paneRef
+   * @param array $selectFields
+   */
   function _selectPaneFields($paneRef, $selectFields = array(
     )) {
     $pane = $this->_advanceSearchPanesDateFilter($paneRef);
@@ -214,7 +225,12 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
     }
   }
 
-  function _advanceSearchPanesDateFilter($paneRef = NULL) {
+  /**
+   * @param null $paneRef
+   *
+   * @return array
+   */
+  public function _advanceSearchPanesDateFilter($paneRef = NULL) {
     static $_advance_search_panes;
 
     if (!isset($_advance_search_panes) || empty($_advance_search_panes)) {
@@ -291,7 +307,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
                 array(
                       'type' => 'select',
                       'locator' => 'contribution_date_relative',
-                      'values' => array('This Day'),
+                      'values' => array('Today'),
             ),
           ),
         ),
@@ -352,4 +368,3 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
     return $_advance_search_panes;
   }
 }
-