Merge pull request #4979 from xurizaemon/codingstandards-12
[civicrm-core.git] / tests / phpunit / WebTest / Report / LoggingReportTest.php
index 59b4cffdbf95d8bfec9d3533f517dfa9fcafd544..322eb374d03607bc1e67615c2bd04d384010ba7c 100644 (file)
@@ -49,7 +49,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->enableComponents("CiviCase");
 
     //add new contact
-    $orginalFirstName = $firstName = 'Anthony' . substr(sha1(rand()), 0, 7);
+    $originalFirstName = $firstName = 'Anthony' . substr(sha1(rand()), 0, 7);
     $lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
 
     $this->webtestAddContact($firstName, $lastName);
@@ -177,6 +177,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
 
     //visit the logging contact summary report
     $this->openCiviPage('report/logging/contact/summary', 'reset=1');
+    $this->waitForElementPresent('altered_contact_value');
     $this->type('altered_contact_value', $firstName);
     $this->click("_qf_LoggingSummary_submit");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -189,28 +190,28 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Delete"
+        "action" => "Delete",
       ),
       //group data check
       array(
         "log_type" => "Group",
         "altered_contact" => "{$firstName} {$lastName} [Case Resources]",
-        "action" => "Added"
+        "action" => "Added",
       ),
       array(
         "log_type" => "Group",
         "altered_contact" => "{$firstName} {$lastName} [Case Resources]",
-        "action" => "Removed"
+        "action" => "Removed",
       ),
       //note data check
       array("log_type" => "Note", "altered_contact" => "{$firstName} {$lastName}", "action" => "Update"),
@@ -221,30 +222,30 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Tag",
         "altered_contact" => "{$firstName} {$lastName} [Government Entity]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       array("log_type" => "Tag", "altered_contact" => "{$firstName} {$lastName} [Company]", "action" => "Delete"),
       //case data check
       array(
         "log_type" => "Case",
         "altered_contact" => "{$firstName} {$lastName} [Housing Support]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Case",
         "altered_contact" => "{$firstName} {$lastName} [Housing Support]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       //case activity check
       array(
         "log_type" => "Activity",
         "altered_contact" => "{$firstName} {$lastName} [Interview]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Activity",
         "altered_contact" => "{$firstName} {$lastName} [Interview]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
     );
     $this->verifyReportData($data);
@@ -254,18 +255,18 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $contactInfo['data'] = array(
       array(
         'field' => 'Sort Name',
-        'changed_from' => "{$lastName}, {$orginalFirstName}",
-        'changed_to' => "{$lastName}, {$firstName}"
+        'changed_from' => "{$lastName}, {$originalFirstName}",
+        'changed_to' => "{$lastName}, {$firstName}",
       ),
       array(
         'field' => 'Display Name',
-        'changed_from' => "{$orginalFirstName} {$lastName}",
-        'changed_to' => "{$firstName} {$lastName}"
+        'changed_from' => "{$originalFirstName} {$lastName}",
+        'changed_to' => "{$firstName} {$lastName}",
       ),
-      array('field' => 'First Name', 'changed_from' => $orginalFirstName, 'changed_to' => $firstName),
-      // array('field' => 'Email Greeting', 'changed_from' => "Dear {$orginalFirstName}", 'changed_to' => "Dear {$firstName}"),
-      // array('field' => 'Postal Greeting', 'changed_from' => "Dear {$orginalFirstName}", 'changed_to' => "Dear {$firstName}"),
-      // array('field' => 'Addressee', 'changed_from' => "{$orginalFirstName} {$lastName}", 'changed_to' => "{$firstName} {$lastName}"),
+      array('field' => 'First Name', 'changed_from' => $originalFirstName, 'changed_to' => $firstName),
+      // array('field' => 'Email Greeting', 'changed_from' => "Dear {$originalFirstName}", 'changed_to' => "Dear {$firstName}"),
+      // array('field' => 'Postal Greeting', 'changed_from' => "Dear {$originalFirstName}", 'changed_to' => "Dear {$firstName}"),
+      // array('field' => 'Addressee', 'changed_from' => "{$originalFirstName} {$lastName}", 'changed_to' => "{$firstName} {$lastName}"),
     );
     $contactInfo = array_merge($contactInfo, $data[0]);
 
@@ -313,8 +314,8 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Contact",
         "altered_contact" => "{$firstName} {$lastName}",
-        "action" => "Delete (to trash)"
-      )
+        "action" => "Delete (to trash)",
+      ),
     );
     $this->verifyReportData($contactDataDelete);