public function testGenerateWithLengthOption($format, $startDate, $endDate, $pattern)
{
$map = array(array('format', $format), array('startDate', $startDate), array('endDate', $endDate));
$this->mockCaller->expects($this->exactly(3))->method('getOption')->will($this->returnValueMap($map));
$fakeDate = $this->dateGenerator->generate();
$this->assertTrue((bool) preg_match($pattern, $fakeDate), sprintf('The date %s doesn\'t match the expression %s', $fakeDate, $pattern));
}