function yearRange($value) { $range = new VF_Year_Range($value); if (isset($this->getConfig()->importer->Y2KMode) && false === $this->getConfig()->importer->Y2KMode) { $range->setY2KMode(false); } if ($this->getConfig()->importer->Y2KThreshold) { $range->setThreshold($this->getConfig()->importer->Y2KThreshold); } return $range; }
function testShouldUseCenturyThreshold_StartYear() { $range = new VF_Year_Range('20-40'); $range->setThreshold(21); $this->assertEquals(2020, $range->start(), 'should use century threshold on start year'); }
function test4DigitEndShouldBeValid() { $range = new VF_Year_Range('-2005'); $this->assertTrue( $range->isValid(), '4 digit end year should be valid range' ); }