/** * @test * @return void */ public function initializeSearchActionSetsDateFormat() { $settings = ['search' => ['dateFormat' => 'Y-m-d']]; $this->subject->_set('arguments', $this->getInitializeSearchActionArgumentMock('Y-m-d')); $this->subject->_set('settings', $settings); $this->subject->initializeSearchAction(); }
/** * @test * @return void */ public function initializeSaveRegistrationActionSetsDateFormat() { $settings = array('registration' => array('formatDateOfBirth' => 'd.m.Y')); $mockPropertyMapperConfig = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfiguration', array(), array(), '', FALSE); $mockPropertyMapperConfig->expects($this->any())->method('setTypeConverterOption')->with($this->equalTo('TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter'), $this->equalTo('dateFormat'), $this->equalTo('d.m.Y')); $mockDateOfBirthPmConfig = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfiguration', array(), array(), '', FALSE); $mockDateOfBirthPmConfig->expects($this->once())->method('forProperty')->with('dateOfBirth')->will($this->returnValue($mockPropertyMapperConfig)); $mockRegistrationArgument = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Argument', array(), array(), '', FALSE); $mockRegistrationArgument->expects($this->once())->method('getPropertyMappingConfiguration')->will($this->returnValue($mockDateOfBirthPmConfig)); $mockArguments = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments', array(), array(), '', FALSE); $mockArguments->expects($this->at(0))->method('getArgument')->with('registration')->will($this->returnValue($mockRegistrationArgument)); $this->subject->_set('arguments', $mockArguments); $this->subject->_set('settings', $settings); $this->subject->initializeSaveRegistrationAction(); }