/** * Get string describing birth county * * @return string One of the birth county identifier constants */ public function getBirthCounty() { if ($this->getDate() < DateTimeCreator::createFromFormat('Ymd', '19900101')) { $countyNr = (int) substr($this->getSerialPostDelimiter(), 0, 2); foreach (self::$birthCountyMap as $limit => $identifier) { if ($countyNr <= $limit) { return $identifier; } } } return Id::COUNTY_UNDEFINED; }
public function testCreateFromFormatException() { $this->setExpectedException('byrokrat\\id\\Exception\\InvalidDateStructureException'); DateTimeCreator::createFromFormat('ymd', '14xx80'); }