for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Validator
*
* Copyright (c) 2017 pudelek.org.pl
* @license MIT License (MIT)
* For the full copyright and license information, please view source file
* that is bundled with this package in the file LICENSE
* @author Marcin Pudełek <[email protected]>
*/
namespace mrcnpdlk\Validator;
use mrcnpdlk\Validator\Types\Nrb;
class NrbTest extends TestCase
{
public function testBankAccountValid()
$defNr = '13 1020-2791 2123 5389 7801 0731';
$res = new Nrb($defNr);
$this->assertEquals('13102027912123538978010731',$res->get());
$this->assertEquals('102',$res->getBank());
$this->assertEquals('10202791',$res->getBankDepartment());
}
* @expectedException \mrcnpdlk\Validator\Exception
public function testBankAccountInvalidChecksum()
new Nrb('13102027912123538978010730');
public function testBankAccountInvalidRegex()
new Nrb('131020279121235389780aaa');
public function testBankAccountInvalidBankDepartment()
new Nrb('04 0000 0000 0000 0000 0000 0000');