@@ -173,7 +173,7 @@ public function testListActionWithoutFilter(): void
173173 }
174174
175175 /**
176- * @dataProvider listActionData
176+ * @dataProvider provideListActionCases
177177 */
178178 public function testListAction (string |false $ context ): void
179179 {
@@ -184,9 +184,7 @@ public function testListAction(string|false $context): void
184184
185185 $ datagrid = $ this ->createMock (DatagridInterface::class);
186186
187- $ form = $ this ->getMockBuilder (Form::class)
188- ->disableOriginalConstructor ()
189- ->getMock ();
187+ $ form = $ this ->createMock (Form::class);
190188
191189 $ form ->expects (static ::once ())
192190 ->method ('createView ' )
@@ -219,20 +217,18 @@ public function testListAction(string|false $context): void
219217 }
220218
221219 /**
222- * @return array <string, mixed >
220+ * @return iterable <string, array{string|false} >
223221 */
224- public function listActionData (): array
222+ public function provideListActionCases (): iterable
225223 {
226- return [
227- 'context ' => ['default ' ],
228- 'no context ' => [false ],
229- ];
224+ yield 'context ' => ['default ' ];
225+ yield 'no context ' => [false ];
230226 }
231227
232228 /**
233- * @dataProvider treeActionData
229+ * @dataProvider provideTreeActionCases
234230 *
235- * @param array<string, string> $categories
231+ * @param array<array{ string, string} > $categories
236232 */
237233 public function testTreeAction (string |false $ context , array $ categories ): void
238234 {
@@ -292,22 +288,20 @@ public function testTreeAction(string|false $context, array $categories): void
292288 }
293289
294290 /**
295- * @return array< string, mixed >
291+ * @return iterable<string, array{string|false, array<array{ string, string}>} >
296292 */
297- public function treeActionData (): array
293+ public function provideTreeActionCases (): iterable
298294 {
299- return [
300- 'context and no categories ' => ['default ' , []],
301- 'no context and no categories ' => [false , []],
302- 'context and categories ' => ['default ' , [
303- ['First Category ' , 'other ' ],
304- ['Second Category ' , 'default ' ],
305- ]],
306- 'no context and categories ' => [false , [
307- ['First Category ' , 'other ' ],
308- ['Second Category ' , 'default ' ],
309- ]],
310- ];
295+ yield 'context and no categories ' => ['default ' , []];
296+ yield 'no context and no categories ' => [false , []];
297+ yield 'context and categories ' => ['default ' , [
298+ ['First Category ' , 'other ' ],
299+ ['Second Category ' , 'default ' ],
300+ ]];
301+ yield 'no context and categories ' => [false , [
302+ ['First Category ' , 'other ' ],
303+ ['Second Category ' , 'default ' ],
304+ ]];
311305 }
312306
313307 /**
0 commit comments