public function testFilterFormat() { $filter = new DateTime('Y-m-d H:i:s'); $expect = new \DateTime('2010-10-10 00:00:00'); $this->assertEquals('2010-10-10 00:00:00', $filter->apply($expect)); $this->assertEquals('2010-10-10 00:00:00', $filter->apply('10.10.2010')); $this->assertEquals(false, $filter->apply('foobar')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); }