‪TYPO3CMS  9.5
SubmitViewHelperTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;
18 
23 {
27  protected ‪$viewHelper;
28 
29  protected function ‪setUp()
30  {
31  parent::setUp();
32  $this->viewHelper = $this->getAccessibleMock(\‪TYPO3\CMS\Fluid\ViewHelpers\Form\SubmitViewHelper::class, ['dummy']);
33  $this->arguments['name'] = '';
34  $this->‪injectDependenciesIntoViewHelper($this->viewHelper);
35  }
36 
41  {
42  $tagBuilder = $this->prophesize(TagBuilder::class);
43  $tagBuilder->render()->shouldBeCalled();
44  // @todo remove condition once typo3fluid/fluid version 2.6.0 will be the minimum version
45  if (class_exists(\‪TYPO3Fluid\Fluid\ViewHelpers\InlineViewHelper::class)) {
46  $tagBuilder->reset()->shouldBeCalled();
47  }
48  $tagBuilder->addAttribute('type', 'submit')->shouldBeCalled();
49  $tagBuilder->addAttribute('value', null)->shouldBeCalled();
50  $tagBuilder->setTagName('input')->shouldBeCalled();
51 
52  $this->viewHelper->setTagBuilder($tagBuilder->reveal());
53 
54  $this->viewHelper->initializeArgumentsAndRender();
55  }
56 }
‪TYPO3Fluid
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\FormFieldViewHelperBaseTestcase\injectDependenciesIntoViewHelper
‪injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper)
Definition: FormFieldViewHelperBaseTestcase.php:40
‪TYPO3
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\FormFieldViewHelperBaseTestcase
Definition: FormFieldViewHelperBaseTestcase.php:24
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SubmitViewHelperTest\setUp
‪setUp()
Definition: SubmitViewHelperTest.php:28
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form
Definition: AbstractFormFieldViewHelperTest.php:2
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SubmitViewHelperTest
Definition: SubmitViewHelperTest.php:23
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SubmitViewHelperTest\renderCorrectlySetsTagNameAndDefaultAttributes
‪renderCorrectlySetsTagNameAndDefaultAttributes()
Definition: SubmitViewHelperTest.php:39
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SubmitViewHelperTest\$viewHelper
‪TYPO3 CMS Fluid ViewHelpers Form SubmitViewHelper $viewHelper
Definition: SubmitViewHelperTest.php:26