[TASK] Shorten the extend class in all unit tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / beuser / Tests / Unit / Domain / Model / DemandTest.php
1 <?php
2 namespace TYPO3\CMS\Beuser\Tests\Unit\Domain\Model;
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
17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
18
19 /**
20 * Test case for class \TYPO3\CMS\Beuser\Domain\Model\Demand
21 */
22 class DemandTest extends UnitTestCase
23 {
24 /**
25 * @var \TYPO3\CMS\Beuser\Domain\Model\Demand
26 */
27 protected $subject;
28
29 protected function setUp()
30 {
31 $this->subject = new \TYPO3\CMS\Beuser\Domain\Model\Demand();
32 }
33
34 /**
35 * @test
36 */
37 public function setUserTypeAllExpectedValueForInt()
38 {
39 $userType = \TYPO3\CMS\Beuser\Domain\Model\Demand::ALL;
40 $this->subject->setUserType($userType);
41 $this->assertSame($this->subject->getUserType(), $userType);
42 }
43
44 /**
45 * @test
46 */
47 public function setUserTypeAdminOnlyExpectedValueForInt()
48 {
49 $userType = \TYPO3\CMS\Beuser\Domain\Model\Demand::USERTYPE_ADMINONLY;
50 $this->subject->setUserType($userType);
51 $this->assertSame($this->subject->getUserType(), $userType);
52 }
53
54 /**
55 * @test
56 */
57 public function setUserTypeUserOnlyExpectedValueForInt()
58 {
59 $userType = \TYPO3\CMS\Beuser\Domain\Model\Demand::USERTYPE_USERONLY;
60 $this->subject->setUserType($userType);
61 $this->assertSame($this->subject->getUserType(), $userType);
62 }
63
64 /**
65 * @test
66 */
67 public function setStatusAllExpectedValueForInt()
68 {
69 $status = \TYPO3\CMS\Beuser\Domain\Model\Demand::ALL;
70 $this->subject->setStatus($status);
71 $this->assertSame($this->subject->getStatus(), $status);
72 }
73
74 /**
75 * @test
76 */
77 public function setStatusActiveExpectedValueForInt()
78 {
79 $status = \TYPO3\CMS\Beuser\Domain\Model\Demand::STATUS_ACTIVE;
80 $this->subject->setStatus($status);
81 $this->assertSame($this->subject->getStatus(), $status);
82 }
83
84 /**
85 * @test
86 */
87 public function setStatusInactiveExpectedValueForInt()
88 {
89 $status = \TYPO3\CMS\Beuser\Domain\Model\Demand::STATUS_INACTIVE;
90 $this->subject->setStatus($status);
91 $this->assertSame($this->subject->getStatus(), $status);
92 }
93
94 /**
95 * @test
96 */
97 public function setLoginAllExpectedValueForInt()
98 {
99 $login = \TYPO3\CMS\Beuser\Domain\Model\Demand::ALL;
100 $this->subject->setLogins($login);
101 $this->assertSame($this->subject->getLogins(), $login);
102 }
103
104 /**
105 * @test
106 */
107 public function setLoginNoneExpectedValueForInt()
108 {
109 $login = \TYPO3\CMS\Beuser\Domain\Model\Demand::LOGIN_NONE;
110 $this->subject->setLogins($login);
111 $this->assertSame($this->subject->getLogins(), $login);
112 }
113
114 /**
115 * @test
116 */
117 public function setLoginxSameExpectedValueForInt()
118 {
119 $login = \TYPO3\CMS\Beuser\Domain\Model\Demand::LOGIN_SOME;
120 $this->subject->setLogins($login);
121 $this->assertSame($this->subject->getLogins(), $login);
122 }
123
124 /**
125 * @test
126 */
127 public function getUserNameInitialValueForString()
128 {
129 $this->assertSame($this->subject->getUserName(), '', 'UserName must be empty string.');
130 }
131
132 /**
133 * @test
134 */
135 public function setUserNameReturnExpectedValueForString()
136 {
137 $newUserName = 'User#รครค*%^name';
138 $this->subject->setUserName($newUserName);
139 $this->assertSame($this->subject->getUserName(), $newUserName, 'UserName is not as set before.');
140 }
141 }