‪TYPO3CMS  10.4
MenuItemTest.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 TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪MenuItemTest extends UnitTestCase
25 {
32  {
33  $menuItem = new ‪MenuItem();
34  $isValid = $menuItem->isValid($menuItem);
35  self::assertFalse($isValid);
36  }
37 
44  {
45  $menuItem = new ‪MenuItem();
46  $menuItem->setTitle('huhu');
47  $isValid = $menuItem->isValid($menuItem);
48  self::assertFalse($isValid);
49  }
50 
57  {
58  $menuItem = new ‪MenuItem();
59  $menuItem->setHref('husel');
60  $isValid = $menuItem->isValid($menuItem);
61  self::assertFalse($isValid);
62  }
63 
70  {
71  $menuItem = new ‪MenuItem();
72  $menuItem->setTitle('husel')->setHref('husel');
73  $isValid = $menuItem->isValid($menuItem);
74  self::assertTrue($isValid);
75  }
76 }
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem
Definition: MenuItem.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu
Definition: MenuItemTest.php:16
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu\MenuItemTest\isMenuItemValidOmittedHrefAndRouteExpectFalse
‪isMenuItemValidOmittedHrefAndRouteExpectFalse()
Definition: MenuItemTest.php:43
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu\MenuItemTest\isMenuItemValidSetValidHrefAndTitleExpectTrue
‪isMenuItemValidSetValidHrefAndTitleExpectTrue()
Definition: MenuItemTest.php:69
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu\MenuItemTest\isMenuItemValidBlankCallExpectFalse
‪isMenuItemValidBlankCallExpectFalse()
Definition: MenuItemTest.php:31
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu\MenuItemTest\isMenuItemValidOmittedTitleExpectFalse
‪isMenuItemValidOmittedTitleExpectFalse()
Definition: MenuItemTest.php:56
‪TYPO3\CMS\Backend\Tests\Unit\Template\Components\Menu\MenuItemTest
Definition: MenuItemTest.php:25