Skip to content

Commit

Permalink
Merge pull request #212 from mundipagg/feature-PAA-228-allow-24-insta…
Browse files Browse the repository at this point in the history
…llments

[Feature] Allow 24 installments
  • Loading branch information
vberardi authored Mar 1, 2021
2 parents 58cff37 + 197f748 commit 76b1a11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Kernel/ValueObjects/Installment.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function __construct($times, $baseTotal, $interest)
private function setTimes($times)
{
$newTimes = intval($times);
if ($newTimes < 1 || $newTimes > 12) {
if ($newTimes < 1 || $newTimes > 24) {
throw new InvalidParamException(
"A installment times should be set between 1 and 12!",
"A installment times should be set between 1 and 24!",
$times
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Kernel/ValueObjects/InstallmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function aInstallmentShouldBeJsonSerializable()
* @uses \Mundipagg\Core\Kernel\ValueObjects\Installment
* @uses \Mundipagg\Core\Kernel\Exceptions\InvalidParamException
*/
public function installmentTimesShouldBeBetween1And12()
public function installmentTimesShouldBeBetween1And24()
{
for ($times = 1; $times <= 12; $times++) {
for ($times = 1; $times <= 24; $times++) {
$installment = new Installment(
$times,
1,
Expand All @@ -79,7 +79,7 @@ public function installmentTimesShouldBeBetween1And12()
for($try = 0; $try < $tries; $try++) {
try {
$installment = new Installment(
rand(13, 100000),
rand(25, 100),
1,
0
);
Expand Down

0 comments on commit 76b1a11

Please sign in to comment.