‪TYPO3CMS  9.5
LinkButtonTest.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 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪LinkButtonTest extends UnitTestCase
25 {
32  {
33  $button = new ‪LinkButton();
34  $isValid = $button->isValid();
35  $this->assertFalse($isValid);
36  }
37 
44  {
45  $button = new ‪LinkButton();
46  $button->setHref('#')->setTitle('huhu');
47  $isValid = $button->isValid();
48  $this->assertFalse($isValid);
49  }
50 
57  {
58  $button = new ‪LinkButton();
59  $icon = new ‪Icon();
60  $button->setHref('husel')->setIcon($icon);
61  $isValid = $button->isValid();
62  $this->assertFalse($isValid);
63  }
64 
71  {
72  $button = new ‪LinkButton();
73  $icon = new ‪Icon();
74  $button->setTitle('husel')->setIcon($icon);
75  $isValid = $button->isValid();
76  $this->assertFalse($isValid);
77  }
78 
85  {
86  $button = new ‪LinkButton();
87  $icon = new ‪Icon();
88  $button->setTitle('husel')->setHref('husel')->setIcon($icon);
89  $isValid = $button->isValid();
90  $this->assertTrue($isValid);
91  }
92 }
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Button
Definition: FullyRenderedButtonTest.php:2