diff --git a/CHANGELOG.md b/CHANGELOG.md index bbd0da0..25d893f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.1.5] - 2024-07-24 ### Fixed -- The length of the Bolivian account was changed from 22 digits to minimum of 10. +- The length of the Bolivian account was changed from 22 to between 10-22 digits. ## [1.1.4] - 2024-07-17 diff --git a/src/Bo/BoBankAccount.php b/src/Bo/BoBankAccount.php index 51c82d0..5d15b54 100644 --- a/src/Bo/BoBankAccount.php +++ b/src/Bo/BoBankAccount.php @@ -25,7 +25,7 @@ public function getAccountTile(): string public function isValid(): bool { - if (preg_match('/^([a-zA-Z]{3})\+([0-9]{10,})$/', $this->bank_account_number) !== 1) { + if (preg_match('/^([a-zA-Z]{3})\+([0-9]{10,22})$/', $this->bank_account_number) !== 1) { return false; } diff --git a/tests/Bo/BoBankAccountTest.php b/tests/Bo/BoBankAccountTest.php index 53aaeb0..3b0778e 100644 --- a/tests/Bo/BoBankAccountTest.php +++ b/tests/Bo/BoBankAccountTest.php @@ -26,7 +26,8 @@ public function testIsValid(): void static::assertFalse((new BoBankAccount('ASD+013409'))->isValid()); static::assertFalse((new BoBankAccount('ASD+0105019465114-07'))->isValid()); static::assertFalse((new BoBankAccount('ASD+0105019465119407 More text?'))->isValid()); - static::assertTrue((new BoBankAccount('ASD+12345678913423511616125234567'))->isValid()); + static::assertFalse((new BoBankAccount('ASD+12345678913423511616123'))->isValid()); + static::assertTrue((new BoBankAccount('ASD+1234567891342351161612'))->isValid()); static::assertTrue((new BoBankAccount('ASD+2345678912'))->isValid()); }