‪TYPO3CMS  11.5
CategoryTest.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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
23 class ‪CategoryTest extends UnitTestCase
24 {
29  {
30  $subject = new ‪Category();
31  self::assertSame('', $subject->getTitle());
32  }
33 
37  public function ‪setTitleSetsTitle(): void
38  {
39  $subject = new ‪Category();
40  $subject->setTitle('foo bar');
41  self::assertSame('foo bar', $subject->getTitle());
42  }
43 
48  {
49  $subject = new ‪Category();
50  self::assertSame('', $subject->getDescription());
51  }
52 
56  public function ‪setDescriptionSetsDescription(): void
57  {
58  $subject = new ‪Category();
59  $subject->setDescription('foo bar');
60  self::assertSame('foo bar', $subject->getDescription());
61  }
62 
66  public function ‪getParentInitiallyReturnsNull(): void
67  {
68  $subject = new ‪Category();
69  self::assertNull($subject->getParent());
70  }
71 
75  public function ‪setParentSetsParent(): void
76  {
77  $parent = new ‪Category();
78  $subject = new ‪Category();
79  $subject->setParent($parent);
80  self::assertSame($parent, $subject->getParent());
81  }
82 }
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getParentInitiallyReturnsNull
‪getParentInitiallyReturnsNull()
Definition: CategoryTest.php:66
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getTitleInitiallyReturnsEmptyString
‪getTitleInitiallyReturnsEmptyString()
Definition: CategoryTest.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getDescriptionInitiallyReturnsEmptyString
‪getDescriptionInitiallyReturnsEmptyString()
Definition: CategoryTest.php:47
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest
Definition: CategoryTest.php:24
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model
Definition: CategoryTest.php:18
‪TYPO3\CMS\Extbase\Domain\Model\Category
Definition: Category.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setDescriptionSetsDescription
‪setDescriptionSetsDescription()
Definition: CategoryTest.php:56
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setTitleSetsTitle
‪setTitleSetsTitle()
Definition: CategoryTest.php:37
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setParentSetsParent
‪setParentSetsParent()
Definition: CategoryTest.php:75