‪TYPO3CMS  10.4
CategoryTest.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 ‪CategoryTest extends UnitTestCase
25 {
29  protected ‪$fixture;
30 
31  protected function ‪setUp(): void
32  {
33  parent::setUp();
34  $this->fixture = new ‪Category();
35  }
36 
41  {
42  self::assertSame('', $this->fixture->getTitle());
43  }
44 
48  public function ‪setTitleSetsTitle()
49  {
50  $this->fixture->setTitle('foo bar');
51  self::assertSame('foo bar', $this->fixture->getTitle());
52  }
53 
58  {
59  self::assertSame('', $this->fixture->getDescription());
60  }
61 
65  public function ‪setDescriptionSetsDescription()
66  {
67  $this->fixture->setDescription('foo bar');
68  self::assertSame('foo bar', $this->fixture->getDescription());
69  }
70 
74  public function ‪getParentInitiallyReturnsNull()
75  {
76  self::assertNull($this->fixture->getParent());
77  }
78 
82  public function ‪setParentSetsParent()
83  {
84  $parent = new Category();
85  $this->fixture->setParent($parent);
86  self::assertSame($parent, $this->fixture->getParent());
87  }
88 }
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getParentInitiallyReturnsNull
‪getParentInitiallyReturnsNull()
Definition: CategoryTest.php:73
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getTitleInitiallyReturnsEmptyString
‪getTitleInitiallyReturnsEmptyString()
Definition: CategoryTest.php:39
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\getDescriptionInitiallyReturnsEmptyString
‪getDescriptionInitiallyReturnsEmptyString()
Definition: CategoryTest.php:56
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\$fixture
‪TYPO3 CMS Extbase Domain Model Category $fixture
Definition: CategoryTest.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest
Definition: CategoryTest.php:25
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model
Definition: BackendUserGroupTest.php:16
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setUp
‪setUp()
Definition: CategoryTest.php:30
‪TYPO3\CMS\Extbase\Domain\Model\Category
Definition: Category.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setDescriptionSetsDescription
‪setDescriptionSetsDescription()
Definition: CategoryTest.php:64
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setTitleSetsTitle
‪setTitleSetsTitle()
Definition: CategoryTest.php:47
‪TYPO3\CMS\Extbase\Tests\Unit\Domain\Model\CategoryTest\setParentSetsParent
‪setParentSetsParent()
Definition: CategoryTest.php:81