INFRA-132 - Put space after flow-control (if/switch/for/foreach/while)
[civicrm-core.git] / tests / phpunit / WebTest / Financial / FinancialAccountTest.php
index d8f14719f847e7007350e7e744dccea572518c5b..d81dfde532ae3ed0fe6f27def4e40205bf41a5c9 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Financial_FinancialAccountTest
+ */
 class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
 
   /**
    * Test To Add Financial Account class attributes.
    */
-  function testFinancialAccount() {
+  public function testFinancialAccount() {
     $this->webtestLogin();
 
     // Add new Financial Account
     $orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
-    $uniqueName = explode(" ",$orgName);
+    $uniqueName = explode(" ", $orgName);
     $financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
     $financialAccountDescription = "{$financialAccountTitle} Description";
     $accountingCode = 1033;
-    $financialAccountType = 'Expenses';
+    $financialAccountType = 'Liability';
     $taxDeductible = FALSE;
     $isActive = TRUE;
     $isTax = TRUE;
@@ -48,7 +52,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
     $isDefault = FALSE;
 
     //Add new organisation
-    if($orgName) {
+    if ($orgName) {
       $this->webtestAddOrganization($orgName);
     }
 
@@ -68,7 +72,8 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
 
     $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
     //Varify Data after Adding new Financial Account
-    $verifyData = array('name' => $financialAccountTitle,
+    $verifyData = array(
+    'name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
       'accounting_code' => $accountingCode,
       'tax_rate'   => $taxRate,
@@ -76,7 +81,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
       'is_deductible' => 'off',
       'is_default' => 'off'
     );
-    
+
     $this->assertEquals($orgName, $this->getText("xpath=//*[@id='s2id_contact_id']/a/span[1]"));
 
     $this->_assertFinancialAccount($verifyData);
@@ -88,12 +93,12 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
     $editfinancialAccount = $financialAccountTitle;
     $financialAccountTitle .= ' Edited';
     $orgNameEdit = FALSE;
-    $financialAccountType = 'Revenue';
+    $financialAccountType = 'Liability';
 
     if ($orgNameEdit) {
       $orgNameEdit = 'NGO '.substr(sha1(rand()), 0, 7);
       $this->webtestAddOrganization($orgNameEdit);
-      $uniqueName = explode(" ",$orgNameEdit);
+      $uniqueName = explode(" ", $orgNameEdit);
     }
 
     $this->_testEditFinancialAccount($editfinancialAccount,
@@ -109,13 +114,14 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
       $isDefault
     );
 
-    if($orgNameEdit) {
+    if ($orgNameEdit) {
       $orgName = $orgNameEdit;
     }
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
     $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
 
-    $verifyData = array( 'name' => $financialAccountTitle,
+    $verifyData = array(
+    'name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
       'accounting_code' => $accountingCode,
       'tax_rate'   => $taxRate,
@@ -123,11 +129,11 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
       'is_deductible' => 'off',
       'is_default' => 'off',
     );
-    
+
     $this->assertEquals($orgName, $this->getText("xpath=//*[@id='s2id_contact_id']/a/span[1]"));
-    
+
     $this->_assertFinancialAccount($verifyData);
-    $verifySelectFieldData = array('financial_account_type_id'   => $financialAccountType);
+    $verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
     $this->_assertSelectVerify($verifySelectFieldData);
     $this->click('_qf_FinancialAccount_cancel-botttom');
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']");