-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix BBAN not validated for IBAN validation
- Loading branch information
Showing
4 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/* | ||
* @license https://opensource.org/licenses/MIT MIT License | ||
* @copyright 2022 Ronan GIRON | ||
* @author Ronan GIRON <https://github.com/ElGigi> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code, to the root. | ||
*/ | ||
|
||
namespace ElGigi\Iban\Tests\Validation; | ||
|
||
use ElGigi\Iban\Validation\IbanValidation; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class IbanValidationTest extends TestCase | ||
{ | ||
public function provider(): array | ||
{ | ||
return [ | ||
[ | ||
'iban' => 'AD12 0001 2030 2003 5910 0100', | ||
'valid' => true, | ||
], | ||
[ | ||
'iban' => 'rs18datagadisp', | ||
'valid' => false, | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @dataProvider provider | ||
*/ | ||
public function testValidate(string $iban, bool $valid) | ||
{ | ||
$this->assertSame($valid, IbanValidation::validate($iban)); | ||
} | ||
} |