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\Nip;
class NipTest extends TestCase
{
public function testNipValid()
$defNr = '526-10-40-828';
$res = new Nip($defNr);
$this->assertEquals('5261040828', $res->get());
$this->assertEquals('string', gettype($res->getTaxOffice()));
}
* @expectedException \mrcnpdlk\Validator\Exception
public function testNipInvalidChecksum()
new Nip('5261040829');
public function testNipInvalidRegex()
new Nip('526104088');