Merge pull request #4866 from totten/master-phpcs
[civicrm-core.git] / tests / phpunit / WebTest / Contact / GroupAddTest.php
index 9160f210c49442423b7d265ad458004f3b409477..3eb09cb810f06e71165913518ca439dbbd40e586 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_Contact_GroupAddTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  function testGroupAdd() {
+  public function testGroupAdd() {
     $this->webtestLogin();
 
     $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom');
@@ -82,7 +82,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
 
     //search groups using created by
     $this->type('created_by', $createdBy);
-    $this->clickLink('_qf_Search_refresh');
+    $this->click('_qf_Search_refresh');
 
     //show maximum no. of groups on first result set page
     //as many groups can be created by same creator
@@ -104,7 +104,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->assertElementContainsText("css=div.crm-summary-display_name", $displayName);
   }
 
-  function testGroupReserved() {
+  public function testGroupReserved() {
     $this->webtestLogin('admin');
 
     $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom');
@@ -182,11 +182,11 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param $roleid
+   * @param int $roleid
    *
    * @return string
    */
-  function _testCreateUser($roleid) {
+  public function _testCreateUser($roleid) {
     $this->open($this->sboxPath . "admin/people/create");
 
     $this->waitForElementPresent("edit-submit");
@@ -222,7 +222,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
   /**
    * @param $role
    */
-  function _roleDelete($role) {
+  public function _roleDelete($role) {
     $this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']");
     $this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']");
     $this->waitForElementPresent('edit-delete');
@@ -232,17 +232,17 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->waitForTextPresent("The role has been deleted.");
   }
 
-   /**
-   * Webtest for add contact to group (CRM-15108)
-   */
-  function testAddContactToGroup() {
+  /**
+    * Webtest for add contact to group (CRM-15108)
+    */
+  public function testAddContactToGroup() {
     $this->webtestLogin();
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
     $this->waitForElementPresent('_qf_Contact_upload_view-bottom');
 
     //Create contact.
     $group = "Advisory Board";
-    $firstName = "Adams".substr(sha1(rand()), 0, 4);
+    $firstName = "Adams" . substr(sha1(rand()), 0, 4);
     $lastName = substr(sha1(rand()), 0, 4);
     $email = "{$lastName}.{$firstName}@example.org";
     $this->type('first_name', $firstName);
@@ -273,7 +273,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage('contact/search', 'reset=1');
     $this->waitForElementPresent("_qf_Basic_refresh");
     $this->type('sort_name', $firstName);
-    $this->select('group',"Advisory Board");
+    $this->select('group', "Advisory Board");
     $this->click('_qf_Basic_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']"));