Skip to content

Commit c3064f4

Browse files
committed
[Tests] Fix data-provider with recent versions of PHPUnit
1 parent 5452880 commit c3064f4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/fixtures/make-form/tests/it_generates_form_with_many_to_many_relation.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
use Doctrine\ORM\Query;
1313
use Doctrine\ORM\QueryBuilder;
1414
use Doctrine\Persistence\ManagerRegistry;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension;
16-
use Symfony\Component\Form\PreloadedExtension;
1717
use Symfony\Component\Form\Test\TypeTestCase;
1818

1919
class 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

Comments
 (0)