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\Pesel;
class PeselTest extends TestCase
{
public function testPeselValid()
$defNr = '12271402999';
$res = new Pesel($defNr);
$this->assertEquals('12271402999', $res->get());
$this->assertEquals('2012-07-14', $res->getBirthDate());
$this->assertEquals(Pesel::SEX_M, $res->getSex());
}
* @expectedException \mrcnpdlk\Validator\Exception
public function testPeselInvalid()
new Pesel('12271402990');