* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class DateTimeTest extends FilterTestCase { public function testFilter() { $filter = new DateTime(); $expect = new \DateTime('2010-10-10 00:00:00'); $this->assertInstanceOf('DateTime', $filter->apply($expect)); $this->assertEquals($expect, $filter->apply($expect)); $this->assertEquals($expect, $filter->apply('10.10.2010')); $this->assertEquals(false, $filter->apply('foobar')); // test error message $this->assertErrorMessage($filter->getErrorMessage()); } 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()); } } __halt_compiler();----SIGNATURE:----AZ/KTvz2S3dfxuVQD4ym3ZG2wH3dL2wX22p+WcQ3xor1S3AqK2OSavJhkrmLxfxVPbPtbagebMNuCeHuUZ7uAe3GnDrKfx1EbI7B/e6jOj5xsgJ/llew5e8oh1whRWW1npmiZtvZZLwHZj0h72nIAOah47+zVbRcq1maJeZSzLS2NDs/MVpoBgqDxJi3ZM950PjMGxxNCZCJBvhci3dEGnPtoRLNlTb1RuBX76J0HAQ5Y9XaMTs/04f019lD2mF7f4fjMNvGysT97NosCM/dPMgMXmlxIgMYKIEegtE8+/FhS4RSc+Gz/2od/Ou2JL/wVRCcaF6mLAncCEkt4AZaWLi7ArRwiWzPngb0JXm15MB2iNTBiY25VcywOXMrHInqORAJqB0VztsjooiNr9SuatEXtiruzLcfyenmwVdIvaCCU1W7E1uDxhmxX63uSra3R42yHkMA4yPo3aVrJeMkwhVgVpfaC0jx0d0pnmPBA6rFwCBl0Z82d7O2HiwP02sch0cHU0Sj/UkH406++sSu/mArBnRzMYTbcEVPr88rogtdHn4l4/DM2qqIrN0NBwqz0cjnLp6rIs8YU4dXhoMP9ATvKfvHct9NBkcyzQFsXibqOCmUD3kvvHlnI+NeIdRcjMMvSqHCC+4V8UjfZYsA+fbSMNyxmiFVnimHpQ/+N30=----ATTACHMENT:----MjMxMzYwMzgxNzQ1MDExMyA3ODY3NDM2OTYwMDM3ODQ5IDExNDU0NTAwNjA4NjU3ODI=