public function testInputSpecificationFilterIfSecondNotProvided()
 {
     $element = new DateTimeSelectElement('test');
     $factory = new InputFilterFactory();
     $inputFilter = $factory->createInputFilter(array('test' => $element->getInputSpecification()));
     $inputFilter->setData(array('test' => array('year' => '2013', 'month' => '02', 'day' => '07', 'hour' => '03', 'minute' => '14')));
     $this->assertTrue($inputFilter->isValid());
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function getInputSpecification()
 {
     $inputSpec = parent::getInputSpecification();
     $inputSpec['filters'][] = ['name' => 'DateTimeSelect', 'options' => ['null_on_empty' => true]];
     return $inputSpec;
 }