Issue 1522: style formatting
authorJaap Jansma <jaap.jansma@civicoop.org>
Thu, 30 Jan 2020 10:07:46 +0000 (11:07 +0100)
committerJaap Jansma <jaap.jansma@civicoop.org>
Thu, 30 Jan 2020 10:07:46 +0000 (11:07 +0100)
tests/phpunit/CRM/Utils/RuleTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/ContributionTest.php

index 47ce27e6837cea9862947e440c328632f0400471..52b5253ce4cbfa7baac9b445946ce85c44944615 100644 (file)
@@ -115,14 +115,18 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase {
       ['$1,234,567.89', '.', ',', 'USD', TRUE],
       ['-$1,234,567.89', '.', ',', 'USD', TRUE],
       ['$-1,234,567.89', '.', ',', 'USD', TRUE],
-      ['1234567.89', '.', ',', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'USD', TRUE],
       // Test EURO currency
       ['€1,234,567.89', '.', ',', 'EUR', TRUE],
       ['-€1,234,567.89', '.', ',', 'EUR', TRUE],
       ['€-1,234,567.89', '.', ',', 'EUR', TRUE],
-      ['1234567.89', '.', ',', 'EUR', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'EUR', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'EUR', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'EUR', TRUE],
       // Test Norwegian KR currency
       ['kr1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr 1,234,567.89', '.', ',', 'NOK', TRUE],
@@ -130,15 +134,19 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase {
       ['-kr 1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr-1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr -1,234,567.89', '.', ',', 'NOK', TRUE],
-      ['1234567.89', '.', ',', 'NOK', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'NOK', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'NOK', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'NOK', TRUE],
       // Test different localization options: , as decimal separator and dot as thousand separator
       ['$1.234.567,89', ',', '.', 'USD', TRUE],
       ['-$1.234.567,89', ',', '.', 'USD', TRUE],
       ['$-1.234.567,89', ',', '.', 'USD', TRUE],
       ['1.234.567,89', ',', '.', 'USD', TRUE],
-      ['1234567.89', ',', '.', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, ',', '.', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', ',', '.', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, ',', '.', 'USD', TRUE],
       ['$1,234,567.89', ',', '.', 'USD', FALSE],
       ['-$1,234,567.89', ',', '.', 'USD', FALSE],
       ['$-1,234,567.89', ',', '.', 'USD', FALSE],
@@ -147,8 +155,10 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase {
       ['-$1 234 567,89', ',', ' ', 'USD', TRUE],
       ['$-1 234 567,89', ',', ' ', 'USD', TRUE],
       ['1 234 567,89', ',', ' ', 'USD', TRUE],
-      ['1234567.89', ',', ' ', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, ',', ' ', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', ',', ' ', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, ',', ' ', 'USD', TRUE],
     ];
   }
 
index 02346b4897a330bf7c2d133239a4d48781a8c95a..9a9d5997659e0a43cd0c2fe0506c3d8b7ea6181e 100644 (file)
@@ -3278,7 +3278,7 @@ VALUES
    *
    * If you use this function also set the thousand separator setMonetaryDecimalPoint
    *
-   * @param $thousandSeparator
+   * @param $decimalPoint
    */
   protected function setMonetaryDecimalPoint($decimalPoint) {
     Civi::settings()->set('monetaryDecimalPoint', $decimalPoint);
index 8a86f1233e12d0aedd96867648af5639563d826a..6a3c0a7364ad59c4d3d7e843ba5107e90a1b87c3 100644 (file)
@@ -707,7 +707,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
   /**
    * @dataProvider createLocalizedContributionDataProvider
-   * @param $inputData
+   * @param $totalAmount
    * @param $decimalPoint
    * @param $thousandSeparator
    * @param $currency
@@ -729,7 +729,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     if ($expectedResult) {
       $this->callAPISuccess('Contribution', 'create', $_params);
-    } else {
+    }
+    else {
       $this->callAPIFailure('Contribution', 'create', $_params);
     }
   }
@@ -755,14 +756,18 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       ['$1,234,567.89', '.', ',', 'USD', TRUE],
       ['-$1,234,567.89', '.', ',', 'USD', TRUE],
       ['$-1,234,567.89', '.', ',', 'USD', TRUE],
-      ['1234567.89', '.', ',', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'USD', TRUE],
       // Test EURO currency
       ['€1,234,567.89', '.', ',', 'EUR', TRUE],
       ['-€1,234,567.89', '.', ',', 'EUR', TRUE],
       ['€-1,234,567.89', '.', ',', 'EUR', TRUE],
-      ['1234567.89', '.', ',', 'EUR', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'EUR', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'EUR', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'EUR', TRUE],
       // Test Norwegian KR currency
       ['kr1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr 1,234,567.89', '.', ',', 'NOK', TRUE],
@@ -770,15 +775,19 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       ['-kr 1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr-1,234,567.89', '.', ',', 'NOK', TRUE],
       ['kr -1,234,567.89', '.', ',', 'NOK', TRUE],
-      ['1234567.89', '.', ',', 'NOK', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, '.', ',', 'NOK', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', '.', ',', 'NOK', TRUE],
+      // This is the float format.
+      [1234567.89, '.', ',', 'NOK', TRUE],
       // Test different localization options: , as decimal separator and dot as thousand separator
       ['$1.234.567,89', ',', '.', 'USD', TRUE],
       ['-$1.234.567,89', ',', '.', 'USD', TRUE],
       ['$-1.234.567,89', ',', '.', 'USD', TRUE],
       ['1.234.567,89', ',', '.', 'USD', TRUE],
-      ['1234567.89', ',', '.', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, ',', '.', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', ',', '.', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, ',', '.', 'USD', TRUE],
       ['$1,234,567.89', ',', '.', 'USD', FALSE],
       ['-$1,234,567.89', ',', '.', 'USD', FALSE],
       ['$-1,234,567.89', ',', '.', 'USD', FALSE],
@@ -787,8 +796,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       ['-$1 234 567,89', ',', ' ', 'USD', TRUE],
       ['$-1 234 567,89', ',', ' ', 'USD', TRUE],
       ['1 234 567,89', ',', ' ', 'USD', TRUE],
-      ['1234567.89', ',', ' ', 'USD', TRUE], // This is the float format. Encapsulated in strings
-      [1234567.89, ',', ' ', 'USD', TRUE], // This is the float format.
+      // This is the float format. Encapsulated in strings
+      ['1234567.89', ',', ' ', 'USD', TRUE],
+      // This is the float format.
+      [1234567.89, ',', ' ', 'USD', TRUE],
     ];
   }