‪TYPO3CMS  11.5
LinkButtonTest.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 ‪LinkButtonTest extends UnitTestCase
28 {
34  public function ‪isButtonValidBlankCallExpectFalse(): void
35  {
36  $button = new ‪LinkButton();
37  $isValid = $button->isValid();
38  self::assertFalse($isValid);
39  }
40 
47  {
48  $button = new ‪LinkButton();
49  $button->setHref('#')->setTitle('huhu');
50  $isValid = $button->isValid();
51  self::assertFalse($isValid);
52  }
53 
60  {
61  $button = new ‪LinkButton();
62  $icon = new ‪Icon();
63  $button->setHref('husel')->setIcon($icon);
64  $isValid = $button->isValid();
65  self::assertFalse($isValid);
66  }
67 
74  {
75  $button = new ‪LinkButton();
76  $icon = new ‪Icon();
77  $button->setTitle('husel')->setIcon($icon);
78  $isValid = $button->isValid();
79  self::assertFalse($isValid);
80  }
81 
88  {
89  $button = new ‪LinkButton();
90  $icon = new ‪Icon();
91  $button->setTitle('husel')->setHref('husel')->setIcon($icon);
92  $isValid = $button->isValid();
93  self::assertTrue($isValid);
94  }
95 }
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button
Definition: FullyRenderedButtonTest.php:18