public function testFormatDate() { // Valid date (in german format) $this->assertSame('2014-10-14', SepaUtilities::getDate('14.10.2014')); // Valid date $this->assertSame('2014-10-14', SepaUtilities::getDate('10 14 2014', 'm d Y')); // Invalid date that can be adjusted $this->assertSame('2015-01-14', SepaUtilities::getDate('14.13.2014')); // Just invalid $this->assertFalse(SepaUtilities::getDate('some text')); }