/** * @param \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper * @return void */ protected function injectDependenciesIntoViewHelper(\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper $viewHelper) { $viewHelper->_set('configurationManager', $this->mockConfigurationManager); parent::injectDependenciesIntoViewHelper($viewHelper); }
/** * @test */ public function renderWrapsHiddenFieldsWithDivAndAnAdditionalClassForXhtmlCompatibilityWithRewrittenPropertyMapper() { $viewHelper = $this->getMock($this->buildAccessibleProxy(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class), array('renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'), array(), '', false); $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService()); $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService); parent::injectDependenciesIntoViewHelper($viewHelper); $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField')); $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields')); $viewHelper->expects($this->once())->method('renderHiddenReferrerFields')->will($this->returnValue('hiddenReferrerFields')); $viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('formContent')); $expectedResult = chr(10) . '<div class="hidden">' . 'hiddenIdentityFieldadditionalIdentityFieldshiddenReferrerFields' . chr(10) . '</div>' . chr(10) . 'formContent'; $this->tagBuilder->expects($this->once())->method('setContent')->with($expectedResult); $viewHelper->setArguments(array('hiddenFieldClassName' => 'hidden')); $viewHelper->render(); }
/** * @param ViewHelperInterface $viewHelper * @return void */ protected function injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper) { $viewHelper->_set('configurationManager', $this->mockConfigurationManager); parent::injectDependenciesIntoViewHelper($viewHelper); }