public function isHourWithinRange() { $date = $this->getNormalizedData(); return $date === null || in_array($date->format('H'), $this->getOption('hours')); }
public function testIsHourWithinRange_returnsFalseIfNotContained() { $field = new TimeField('name', array('hours' => array(6, 7))); $field->submit(array('hour' => '08', 'minute' => '12')); $this->assertFalse($field->isHourWithinRange()); }