public function setUp()
 {
     parent::setUp();
     $this->viewHelper = $this->getAccessibleMock('NamelessCoder\\Fluid\\ViewHelpers\\IfViewHelper', array('renderThenChild', 'renderElseChild'));
     $this->injectDependenciesIntoViewHelper($this->viewHelper);
     $this->viewHelper->initializeArguments();
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     $this->viewHelper = $this->getMock('TYPO3Fluid\\Fluid\\ViewHelpers\\CaseViewHelper', array('renderChildren'));
     $this->injectDependenciesIntoViewHelper($this->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();
 }
 public function setUp()
 {
     parent::setUp();
     $this->viewHelper = $this->getMock('NamelessCoder\\Fluid\\ViewHelpers\\GroupedForViewHelper', array('renderChildren'));
     $this->injectDependenciesIntoViewHelper($this->viewHelper);
 }