/** * Escapes a time for use in SQL, includes surrounding quotes * * A `NULL` or invalid value will be returned as `'NULL'` * * @param string $value The time to escape * @return string The escaped time */ private function escapeTime($value) { if ($value === NULL) { return 'NULL'; } try { $value = new fTime($value); if ($this->type == 'mssql' || $this->type == 'oracle') { return "'" . $value->format('1970-01-01 H:i:s') . "'"; } return "'" . $value->format('H:i:s') . "'"; } catch (fValidationException $e) { return 'NULL'; } }
/** * @dataProvider lteProvider */ public function testLte($primary, $secondary, $result) { $time = new fTime($primary); $this->assertEquals($result, $time->lte($secondary)); }