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