whitespace fixes
authorkurund <kurund@civicrm.org>
Mon, 12 Aug 2013 09:45:00 +0000 (15:15 +0530)
committerkurund <kurund@civicrm.org>
Mon, 12 Aug 2013 09:45:00 +0000 (15:15 +0530)
tests/phpunit/WebTest/Activity/IcalTest.php

index 4c42993be72346c1c34744dc19ea68a7f7b369b6..16fea11422b7ca23e85a38972d426eec13c27d50 100644 (file)
@@ -31,87 +31,87 @@ require_once 'ezc/autoload/mail_autoload.php';
 
 class WebTest_Activity_IcalTest extends CiviSeleniumTestCase {
 
-    // This variable is a bit awkward, but the ezc callback function needed to walk through the email parts needs to be static, so use this variable to "report back" on whether we found what we're looking for or not.
-    private static $foundIt = false;
+  // This variable is a bit awkward, but the ezc callback function needed to walk through the email parts needs to be static, so use this variable to "report back" on whether we found what we're looking for or not.
+  private static $foundIt = FALSE;
 
-    protected function setUp() {
-        parent::setUp();
-    }
+  protected function setUp() {
+    parent::setUp();
+  }
 
-    function testStandaloneActivityAdd() {
-        $this->webtestLogin();
+  function testStandaloneActivityAdd() {
+    $this->webtestLogin();
 
-        $this->openCivipage("admin/setting/preferences/display", "reset=1", "name=activity_assignee_notification_ics");
+    $this->openCivipage("admin/setting/preferences/display", "reset=1", "name=activity_assignee_notification_ics");
 
-        // Notify assignees should be checked by default, so we just need to click the ical setting which is off by default.
-        $this->check("name=activity_assignee_notification_ics");
-        $this->click("_qf_Display_next");
-        $this->waitForPageToLoad($this->getTimeoutMsec());
+    // Notify assignees should be checked by default, so we just need to click the ical setting which is off by default.
+    $this->check("name=activity_assignee_notification_ics");
+    $this->click("_qf_Display_next");
+    $this->waitForPageToLoad($this->getTimeoutMsec());
 
-        // Start spooling emails
-        $mailer = new CiviMailUtils($this, true);
-        self::$foundIt = false;
+    // Start spooling emails
+    $mailer = new CiviMailUtils($this, TRUE);
+    self::$foundIt = FALSE;
 
-        $firstName1 = substr(sha1(rand()), 0, 7);
-        $this->webtestAddContact("$firstName1", "Anderson", $firstName1 . "@anderson.com");
+    $firstName1 = substr(sha1(rand()), 0, 7);
+    $this->webtestAddContact("$firstName1", "Anderson", $firstName1 . "@anderson.com");
 
-        $this->openCivipage("activity", "reset=1&action=add&context=standalone", "_qf_Activity_upload");
+    $this->openCivipage("activity", "reset=1&action=add&context=standalone", "_qf_Activity_upload");
 
-        $this->select("activity_type_id", "value=1");
+    $this->select("activity_type_id", "value=1");
 
-        $this->click("token-input-assignee_contact_id");
-        // Because it tends to cause problems, all uses of sleep() must be justified in comments
-        // Sleep should never be used for wait for anything to load from the server
-        // Justification for this instance: tokeninput has a slight delay
-        sleep(1);
-        $this->type("token-input-assignee_contact_id", "$firstName1");
-        $this->typeKeys("token-input-assignee_contact_id", "$firstName1");
+    $this->click("token-input-assignee_contact_id");
+    // Because it tends to cause problems, all uses of sleep() must be justified in comments
+    // Sleep should never be used for wait for anything to load from the server
+    // Justification for this instance: tokeninput has a slight delay
+    sleep(1);
+    $this->type("token-input-assignee_contact_id", "$firstName1");
+    $this->typeKeys("token-input-assignee_contact_id", "$firstName1");
 
-        $this->waitForElementPresent("css=div.token-input-dropdown-facebook");
-        $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook");
-        $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
-        $this->waitForElementPresent("css=tr.crm-activity-form-block-assignee_contact_id td ul li span.token-input-delete-token-facebook");
+    $this->waitForElementPresent("css=div.token-input-dropdown-facebook");
+    $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook");
+    $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
+    $this->waitForElementPresent("css=tr.crm-activity-form-block-assignee_contact_id td ul li span.token-input-delete-token-facebook");
 
-        $subject = "Testing Ical attachment for activity assignee";
-        $this->type("subject", $subject);
+    $subject = "Testing Ical attachment for activity assignee";
+    $this->type("subject", $subject);
 
-        $location = 'Some location needs to be put in this field.';
-        $this->type("location", $location);
+    $location = 'Some location needs to be put in this field.';
+    $this->type("location", $location);
 
-        $this->webtestFillDateTime('activity_date_time', '+1 month 11:10PM');
-        $this->select("status_id", "value=1");
+    $this->webtestFillDateTime('activity_date_time', '+1 month 11:10PM');
+    $this->select("status_id", "value=1");
 
-        $this->click("_qf_Activity_upload");
-        $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->click("_qf_Activity_upload");
+    $this->waitForPageToLoad($this->getTimeoutMsec());
 
-        $this->waitForText('crm-notification-container', $subject);
+    $this->waitForText('crm-notification-container', $subject);
 
-        // check the resulting email
-        $mail = $mailer->getMostRecentEmail('ezc');
-        $this->assertNotNull($mail, ts('Assignee email not generated or problem locating it.'));
-        $this->assertEquals($mail->subject, "$subject");
-        $context = new ezcMailPartWalkContext(array(get_class($this), 'mailWalkCallback'));
-        $mail->walkParts($context, $mail);
+    // check the resulting email
+    $mail = $mailer->getMostRecentEmail('ezc');
+    $this->assertNotNull($mail, ts('Assignee email not generated or problem locating it.'));
+    $this->assertEquals($mail->subject, "$subject");
+    $context = new ezcMailPartWalkContext(array(get_class($this), 'mailWalkCallback'));
+    $mail->walkParts($context, $mail);
 
-        $mailer->stop();
+    $mailer->stop();
 
-        $this->assertTrue(self::$foundIt, ts('Generated email does not contain an ical attachment.'));
-    }
+    $this->assertTrue(self::$foundIt, ts('Generated email does not contain an ical attachment.'));
+  }
 
-    public static function mailWalkCallback($context, $mailPart) {
+  public static function mailWalkCallback($context, $mailPart) {
 
-        $disp = $mailPart->contentDisposition;
-        if ($disp) {
-            if ($disp->disposition == 'attachment') {
-                if ($mailPart instanceof ezcMailText) {
-                    if ($mailPart->subType == 'calendar') {
-                        // For now we just check for existence.
-                        self::$foundIt = true;
+    $disp = $mailPart->contentDisposition;
+    if ($disp) {
+      if ($disp->disposition == 'attachment') {
+        if ($mailPart instanceof ezcMailText) {
+          if ($mailPart->subType == 'calendar') {
+            // For now we just check for existence.
+            self::$foundIt = TRUE;
 
-                    }
-                }
-            }
+          }
         }
+      }
     }
+  }
 }