Skip to content

Commit

Permalink
fix/validator-bol auto-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolass committed Jul 24, 2024
1 parent 3d17b16 commit 4079c0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Bo/BoBankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Bo/BoBankAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 4079c0b

Please sign in to comment.