/** * Ensures that the validator can handle different manual dateformats * * @group ZF-2003 * @return void */ public function testUseManualFormat() { $this->assertTrue($this->validator->setFormat('d.m.Y')->isValid('10.01.2008'), var_export(date_get_last_errors(), 1)); $this->assertEquals('d.m.Y', $this->validator->getFormat()); $this->assertTrue($this->validator->setFormat('m Y')->isValid('01 2010')); $this->assertFalse($this->validator->setFormat('d/m/Y')->isValid('2008/10/22')); $this->assertTrue($this->validator->setFormat('d/m/Y')->isValid('22/10/08')); $this->assertFalse($this->validator->setFormat('d/m/Y')->isValid('22/10')); // Omitting the following assertion, as it varies from 5.3.3 to 5.3.11, // and there is no indication in the PHP changelog as to when or why it // may have changed. Leaving for posterity, to indicate original expectation. // $this->assertFalse($this->validator->setFormat('s')->isValid(0)); }