|
13 | 13 |
|
14 | 14 | namespace Sonata\ClassificationBundle\Tests\Controller; |
15 | 15 |
|
| 16 | +use PHPUnit\Framework\Attributes\DataProvider; |
16 | 17 | use PHPUnit\Framework\MockObject\MockObject; |
17 | 18 | use PHPUnit\Framework\TestCase; |
18 | 19 | use Psr\Container\ContainerInterface; |
@@ -172,9 +173,7 @@ public function testListActionWithoutFilter(): void |
172 | 173 | static::assertSame('tree?hide_context=0', $result->getTargetUrl()); |
173 | 174 | } |
174 | 175 |
|
175 | | - /** |
176 | | - * @dataProvider provideListActionCases |
177 | | - */ |
| 176 | + #[DataProvider('provideListActionCases')] |
178 | 177 | public function testListAction(string|false $context): void |
179 | 178 | { |
180 | 179 | $contextValue = false === $context ? '' : $context; |
@@ -219,17 +218,16 @@ public function testListAction(string|false $context): void |
219 | 218 | /** |
220 | 219 | * @return iterable<string, array{string|false}> |
221 | 220 | */ |
222 | | - public function provideListActionCases(): iterable |
| 221 | + public static function provideListActionCases(): iterable |
223 | 222 | { |
224 | 223 | yield 'context' => ['default']; |
225 | 224 | yield 'no context' => [false]; |
226 | 225 | } |
227 | 226 |
|
228 | 227 | /** |
229 | | - * @dataProvider provideTreeActionCases |
230 | | - * |
231 | 228 | * @param array<array{string, string}> $categories |
232 | 229 | */ |
| 230 | + #[DataProvider('provideTreeActionCases')] |
233 | 231 | public function testTreeAction(string|false $context, array $categories): void |
234 | 232 | { |
235 | 233 | $datagrid = $this->createMock(DatagridInterface::class); |
@@ -290,7 +288,7 @@ public function testTreeAction(string|false $context, array $categories): void |
290 | 288 | /** |
291 | 289 | * @return iterable<string, array{string|false, array<array{string, string}>}> |
292 | 290 | */ |
293 | | - public function provideTreeActionCases(): iterable |
| 291 | + public static function provideTreeActionCases(): iterable |
294 | 292 | { |
295 | 293 | yield 'context and no categories' => ['default', []]; |
296 | 294 | yield 'no context and no categories' => [false, []]; |
|
0 commit comments