‪TYPO3CMS  11.5
InputButtonTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
27 class ‪InputButtonTest extends UnitTestCase
28 {
34  public function ‪isButtonValidBlankCallExpectFalse(): void
35  {
36  $button = new ‪InputButton();
37  $isValid = $button->isValid();
38  self::assertFalse($isValid);
39  }
40 
47  {
48  $button = new ‪InputButton();
49  $button->setName('husel')->setValue('1')->setTitle('huhu');
50  $isValid = $button->isValid();
51  self::assertFalse($isValid);
52  }
53 
60  {
61  $button = new ‪InputButton();
62  $icon = new ‪Icon();
63  $button->setName('husel')->setValue('1')->setIcon($icon);
64  $isValid = $button->isValid();
65  self::assertFalse($isValid);
66  }
67 
74  {
75  $button = new ‪InputButton();
76  $icon = new ‪Icon();
77  $button->setTitle('husel')->setValue('1')->setIcon($icon);
78  $isValid = $button->isValid();
79  self::assertFalse($isValid);
80  }
81 
88  {
89  $button = new ‪InputButton();
90  $icon = new ‪Icon();
91  $button->setTitle('husel')->setName('husel')->setIcon($icon);
92  $isValid = $button->isValid();
93  self::assertFalse($isValid);
94  }
95 
102  {
103  $button = new ‪InputButton();
104  $icon = new ‪Icon();
105  $button->setTitle('husel')->setName('husel')->setIcon($icon)->setValue('1');
106  $isValid = $button->isValid();
107  self::assertTrue($isValid);
108  }
109 }
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidOmittedValueExpectFalse
‪isButtonValidOmittedValueExpectFalse()
Definition: InputButtonTest.php:87
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidOmittedNameExpectFalse
‪isButtonValidOmittedNameExpectFalse()
Definition: InputButtonTest.php:73
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest
Definition: InputButtonTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidAllValuesSetExpectTrue
‪isButtonValidAllValuesSetExpectTrue()
Definition: InputButtonTest.php:101
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button
Definition: FullyRenderedButtonTest.php:18
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidOmittedTitleExpectFalse
‪isButtonValidOmittedTitleExpectFalse()
Definition: InputButtonTest.php:59
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidBlankCallExpectFalse
‪isButtonValidBlankCallExpectFalse()
Definition: InputButtonTest.php:34
‪TYPO3\CMS\Backend\Template\Components\Buttons\InputButton
Definition: InputButton.php:38
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button\InputButtonTest\isButtonValidOmittedIconExpectFalse
‪isButtonValidOmittedIconExpectFalse()
Definition: InputButtonTest.php:46