public function testGetViewValue() { $this->formatter->expects($this->exactly(2))->method('formatDate')->willReturnCallback(function ($input) { return $input->format('Y-m-d'); }); $start = new \DateTime('2014-01-01', new \DateTimeZone('UTC')); $end = new \DateTime('2015-01-01', new \DateTimeZone('UTC')); $this->assertEquals('2014-01-01 - 2015-01-01', $this->converter->getViewValue(['start' => $start, 'end' => $end, 'type' => AbstractDateFilterType::TYPE_BETWEEN])); }
/** * {@inheritdoc} */ public function getViewValue($value) { if (!empty($value)) { return parent::getViewValue($value); } return []; }