Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Aug 5, 2020
1 parent 8267c38 commit 5d41025
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/functions/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function isAmount($expected, $actual, string $message = '', float $allowableDiff
} elseif (is_array($expected) && is_array($actual)) {
isAmountCur($expected, $actual, $message, $allowableDiff);
} else {
fail('$expected and $actual both must be "array" or "float|string|int"');
fail('$expected and $actual both must be "array" OR "float|string|int"');
}
}

Expand All @@ -433,7 +433,7 @@ function isNotAmount($expected, $actual, string $message = '', float $allowableD
} elseif (is_array($expected) && is_array($actual)) {
isNotAmountCur($expected, $actual, $message, $allowableDiff);
} else {
fail('$expected and $actual both must be "array" or "float|string|int"');
fail('$expected and $actual both must be "array" OR "float|string|int"');
}
}

Expand All @@ -454,6 +454,8 @@ function isAmountCur(array $expected, array $actual, string $message = '', float
isTrue(is_string($expected[1]), $message);
isTrue(is_string($actual[1]), $message);
isSame($expected[1], $actual[1], $message);
isNotEmpty($expected[1], $message);
isNotEmpty($actual[1], $message);

Assert::assertEqualsWithDelta((float)$expected[0], (float)$actual[0], $allowableDiff, $message);
}
Expand All @@ -475,6 +477,8 @@ function isNotAmountCur(array $expected, array $actual, string $message = '', fl
isTrue(is_string($expected[1]), $message);
isTrue(is_string($actual[1]), $message);
isSame($expected[1], $actual[1], $message);
isNotEmpty($expected[1], $message);
isNotEmpty($actual[1], $message);

Assert::assertNotEqualsWithDelta((float)$expected[0], (float)$actual[0], $allowableDiff, $message);
}
Expand Down

0 comments on commit 5d41025

Please sign in to comment.