Merge pull request #17143 from mattwire/donthidedisabledmemberships
[civicrm-core.git] / tests / phpunit / CRM / Utils / MoneyTest.php
index 41c5e7c9857061f740751d1a6d5aea5cf1849080..ba6a3dc8ba7320686ecc688ba2a2f7de59dd0926 100644 (file)
@@ -24,12 +24,12 @@ class CRM_Utils_MoneyTest extends CiviUnitTestCase {
   public function testEquals() {
     $testValue = 0.01;
 
-    for ($i = 0; $i <= 10; $i++) {
-      $equalValues = CRM_Utils_Money::equals($testValue, $testValue + ($i * 0.0001), 'USD');
-      $this->assertTrue($equalValues);
+    for ($i = 0; $i < 10; $i++) {
+      $equalValues = CRM_Utils_Money::equals($testValue, $testValue + ($i * 0.0005), 'USD');
+      $this->assertTrue($equalValues, 'Currency - USD' . $testValue . ' is equal to USD' . ($testValue + ($i * 0.0005)));
     }
 
-    $this->assertFalse(CRM_Utils_Money::equals($testValue, $testValue + 0.001000000001, 'USD'));
+    $this->assertFalse(CRM_Utils_Money::equals($testValue + 0.004, $testValue + 0.006, 'USD'), 'Currency - USD' . ($testValue + 0.004) . ' is different to USD' . ($testValue + 0.006));
   }
 
   /**