1212use Doctrine \ORM \Query ;
1313use Doctrine \ORM \QueryBuilder ;
1414use Doctrine \Persistence \ManagerRegistry ;
15+ use PHPUnit \Framework \Attributes \DataProvider ;
1516use Symfony \Bridge \Doctrine \Form \DoctrineOrmExtension ;
16- use Symfony \Component \Form \PreloadedExtension ;
1717use Symfony \Component \Form \Test \TypeTestCase ;
1818
1919class GeneratedFormTest extends TypeTestCase
2020{
2121 /**
2222 * @dataProvider provideFormData
2323 */
24+ #[DataProvider('provideFormData ' )]
2425 public function testGeneratedFormWithMultipleChoices ($ formData , $ collection )
2526 {
2627 $ form = $ this ->factory ->create (BookType::class);
@@ -40,7 +41,7 @@ public function testGeneratedFormWithMultipleChoices($formData, $collection)
4041 }
4142 }
4243
43- public function provideFormData (): iterable
44+ public static function provideFormData (): iterable
4445 {
4546 yield 'test_submit_with_single_choice_selected ' =>
4647 [
@@ -52,7 +53,8 @@ public function provideFormData(): iterable
5253 (new Library ())->setName ('bar ' ),
5354 ]),
5455 ];
55- yield ['test_submit_with_multiple_choices_selected ' =>
56+ yield 'test_submit_with_multiple_choices_selected ' =>
57+ [
5658 [
5759 'title ' => 'foobar ' ,
5860 'libraries ' => [0 , 1 ],
@@ -62,7 +64,8 @@ public function provideFormData(): iterable
6264 (new Library ())->setName ('bar ' ),
6365 ]),
6466 ];
65- yield ['test_submit_with_no_choice_selected ' =>
67+ yield 'test_submit_with_no_choice_selected ' =>
68+ [
6669 [
6770 'title ' => 'foobar ' ,
6871 'libraries ' => [],
0 commit comments