@@ -39,7 +39,7 @@ protected function setUp(): void
3939 $ this ->newsRepositoryMock = $ this ->getMockBuilder (NewsRepository::class)
4040 ->disableOriginalConstructor ()
4141 ->getMock ();
42-
42+
4343 $ this ->subject = new NewsItem ($ this ->newsRepositoryMock );
4444 }
4545
@@ -53,7 +53,7 @@ public function toolbarItemCanBeInstantiated(): void
5353 public function toolbarItemImplementsInterface (): void
5454 {
5555 $ reflection = new \ReflectionClass (NewsItem::class);
56-
56+
5757 self ::assertTrue ($ reflection ->implementsInterface (ToolbarItemInterface::class));
5858 }
5959
@@ -62,14 +62,14 @@ public function constructorAcceptsNewsRepository(): void
6262 {
6363 $ reflection = new \ReflectionClass (NewsItem::class);
6464 $ constructor = $ reflection ->getConstructor ();
65-
65+
6666 self ::assertNotNull ($ constructor );
67-
67+
6868 $ parameters = $ constructor ->getParameters ();
6969 self ::assertCount (1 , $ parameters );
70-
70+
7171 self ::assertEquals ('newsRepository ' , $ parameters [0 ]->getName ());
72-
72+
7373 $ paramType = $ parameters [0 ]->getType ();
7474 self ::assertInstanceOf (\ReflectionNamedType::class, $ paramType );
7575 self ::assertEquals (NewsRepository::class, $ paramType ->getName ());
@@ -79,70 +79,69 @@ public function constructorAcceptsNewsRepository(): void
7979 public function checkAccessReturnsTrue (): void
8080 {
8181 $ result = $ this ->subject ->checkAccess ();
82-
82+
8383 self ::assertTrue ($ result );
8484 }
8585
8686 #[Test]
8787 public function hasDropDownReturnsTrue (): void
8888 {
8989 $ result = $ this ->subject ->hasDropDown ();
90-
90+
9191 self ::assertTrue ($ result );
9292 }
9393
9494 #[Test]
9595 public function getIndexReturns50 (): void
9696 {
9797 $ result = $ this ->subject ->getIndex ();
98-
98+
9999 self ::assertEquals (50 , $ result );
100100 }
101101
102102 #[Test]
103103 public function getAdditionalAttributesReturnsEmptyArray (): void
104104 {
105105 $ result = $ this ->subject ->getAdditionalAttributes ();
106-
107- self ::assertIsArray ($ result );
106+
108107 self ::assertEmpty ($ result );
109108 }
110109
111110 #[Test]
112111 public function toolbarItemMethodsHaveCorrectReturnTypes (): void
113112 {
114113 $ reflection = new \ReflectionClass (NewsItem::class);
115-
114+
116115 // checkAccess
117116 $ checkAccess = $ reflection ->getMethod ('checkAccess ' );
118117 $ returnType = $ checkAccess ->getReturnType ();
119118 self ::assertInstanceOf (\ReflectionNamedType::class, $ returnType );
120119 self ::assertEquals ('bool ' , $ returnType ->getName ());
121-
120+
122121 // getItem
123122 $ getItem = $ reflection ->getMethod ('getItem ' );
124123 $ returnType = $ getItem ->getReturnType ();
125124 self ::assertInstanceOf (\ReflectionNamedType::class, $ returnType );
126125 self ::assertEquals ('string ' , $ returnType ->getName ());
127-
126+
128127 // hasDropDown
129128 $ hasDropDown = $ reflection ->getMethod ('hasDropDown ' );
130129 $ returnType = $ hasDropDown ->getReturnType ();
131130 self ::assertInstanceOf (\ReflectionNamedType::class, $ returnType );
132131 self ::assertEquals ('bool ' , $ returnType ->getName ());
133-
132+
134133 // getDropDown
135134 $ getDropDown = $ reflection ->getMethod ('getDropDown ' );
136135 $ returnType = $ getDropDown ->getReturnType ();
137136 self ::assertInstanceOf (\ReflectionNamedType::class, $ returnType );
138137 self ::assertEquals ('string ' , $ returnType ->getName ());
139-
138+
140139 // getAdditionalAttributes
141140 $ getAdditionalAttributes = $ reflection ->getMethod ('getAdditionalAttributes ' );
142141 $ returnType = $ getAdditionalAttributes ->getReturnType ();
143142 self ::assertInstanceOf (\ReflectionNamedType::class, $ returnType );
144143 self ::assertEquals ('array ' , $ returnType ->getName ());
145-
144+
146145 // getIndex
147146 $ getIndex = $ reflection ->getMethod ('getIndex ' );
148147 $ returnType = $ getIndex ->getReturnType ();
@@ -154,16 +153,16 @@ public function toolbarItemMethodsHaveCorrectReturnTypes(): void
154153 public function toolbarItemMethodsArePublic (): void
155154 {
156155 $ reflection = new \ReflectionClass (NewsItem::class);
157-
156+
158157 $ methods = [
159158 'checkAccess ' ,
160- 'getItem ' ,
159+ 'getItem ' ,
161160 'hasDropDown ' ,
162161 'getDropDown ' ,
163162 'getAdditionalAttributes ' ,
164- 'getIndex '
163+ 'getIndex ' ,
165164 ];
166-
165+
167166 foreach ($ methods as $ methodName ) {
168167 $ method = $ reflection ->getMethod ($ methodName );
169168 self ::assertTrue ($ method ->isPublic (), "Method {$ methodName } should be public " );
@@ -175,12 +174,12 @@ public function toolbarItemMethodsArePublic(): void
175174 public function toolbarItemHasProtectedConfigurationProperty (): void
176175 {
177176 $ reflection = new \ReflectionClass (NewsItem::class);
178-
177+
179178 self ::assertTrue ($ reflection ->hasProperty ('configuration ' ));
180-
179+
181180 $ property = $ reflection ->getProperty ('configuration ' );
182181 self ::assertTrue ($ property ->isProtected ());
183-
182+
184183 $ propertyType = $ property ->getType ();
185184 self ::assertInstanceOf (\ReflectionNamedType::class, $ propertyType );
186185 self ::assertEquals ('array ' , $ propertyType ->getName ());
@@ -190,7 +189,7 @@ public function toolbarItemHasProtectedConfigurationProperty(): void
190189 public function toolbarItemUsesCorrectNamespace (): void
191190 {
192191 $ reflection = new \ReflectionClass (NewsItem::class);
193-
192+
194193 self ::assertEquals ('Xima\XimaTypo3InternalNews\Backend\ToolbarItems ' , $ reflection ->getNamespaceName ());
195194 self ::assertEquals ('NewsItem ' , $ reflection ->getShortName ());
196195 }
@@ -199,19 +198,19 @@ public function toolbarItemUsesCorrectNamespace(): void
199198 public function toolbarItemMethodsHaveNoParameters (): void
200199 {
201200 $ reflection = new \ReflectionClass (NewsItem::class);
202-
201+
203202 $ parameterlessMethods = [
204203 'checkAccess ' ,
205204 'getItem ' ,
206- 'hasDropDown ' ,
205+ 'hasDropDown ' ,
207206 'getDropDown ' ,
208207 'getAdditionalAttributes ' ,
209- 'getIndex '
208+ 'getIndex ' ,
210209 ];
211-
210+
212211 foreach ($ parameterlessMethods as $ methodName ) {
213212 $ method = $ reflection ->getMethod ($ methodName );
214213 self ::assertCount (0 , $ method ->getParameters (), "Method {$ methodName } should have no parameters " );
215214 }
216215 }
217- }
216+ }
0 commit comments