Skip to content

Commit 1cdad5a

Browse files
VincentLangletgithub-actions[bot]
authored andcommitted
Fix
1 parent 4697b6e commit 1cdad5a

6 files changed

Lines changed: 29 additions & 35 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"phpunit/phpunit": "^9.5",
6060
"psalm/plugin-phpunit": "^0.18",
6161
"psalm/plugin-symfony": "^5.0",
62-
"rector/rector": "^0.17",
62+
"rector/rector": "^0.18",
6363
"sonata-project/admin-bundle": "^4.14",
6464
"sonata-project/block-bundle": "^4.11 || ^5.0",
6565
"sonata-project/doctrine-orm-admin-bundle": "^4.0",

tests/Controller/CategoryAdminControllerTest.php

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/**

tests/Functional/Admin/CategoryAdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function provideCrudUrlsCases(): iterable
5757
}
5858

5959
/**
60-
* @dataProvider provideFormUrlsCases
60+
* @dataProvider provideFormsUrlsCases
6161
*
6262
* @param array<string, mixed> $parameters
6363
* @param array<string, mixed> $fieldValues
@@ -80,7 +80,7 @@ public function testFormsUrls(string $url, array $parameters, string $button, ar
8080
*
8181
* @phpstan-return iterable<array{0: string, 1: array<string, mixed>, 2: string, 3?: array<string, mixed>}>
8282
*/
83-
public static function provideFormUrlsCases(): iterable
83+
public static function provideFormsUrlsCases(): iterable
8484
{
8585
yield 'Create Category' => ['/admin/tests/app/category/create', [
8686
'uniqid' => 'category',

tests/Functional/Admin/CollectionAdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function provideCrudUrlsCases(): iterable
4848
}
4949

5050
/**
51-
* @dataProvider provideFormUrlsCases
51+
* @dataProvider provideFormsUrlsCases
5252
*
5353
* @param array<string, mixed> $parameters
5454
* @param array<string, mixed> $fieldValues
@@ -71,7 +71,7 @@ public function testFormsUrls(string $url, array $parameters, string $button, ar
7171
*
7272
* @phpstan-return iterable<array{0: string, 1: array<string, mixed>, 2: string, 3?: array<string, mixed>}>
7373
*/
74-
public static function provideFormUrlsCases(): iterable
74+
public static function provideFormsUrlsCases(): iterable
7575
{
7676
yield 'Create Collection' => ['/admin/tests/app/collection/create', [
7777
'uniqid' => 'collection',

tests/Functional/Admin/ContextAdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function provideCrudUrlsCases(): iterable
4747
}
4848

4949
/**
50-
* @dataProvider provideFormUrlsCases
50+
* @dataProvider provideFormsUrlsCases
5151
*
5252
* @param array<string, mixed> $parameters
5353
* @param array<string, mixed> $fieldValues
@@ -70,7 +70,7 @@ public function testFormsUrls(string $url, array $parameters, string $button, ar
7070
*
7171
* @phpstan-return iterable<array{0: string, 1: array<string, mixed>, 2: string, 3?: array<string, mixed>}>
7272
*/
73-
public static function provideFormUrlsCases(): iterable
73+
public static function provideFormsUrlsCases(): iterable
7474
{
7575
yield 'Create Context' => ['/admin/tests/app/context/create', [
7676
'uniqid' => 'context',

tests/Functional/Admin/TagAdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function provideCrudUrlsCases(): iterable
4848
}
4949

5050
/**
51-
* @dataProvider provideFormUrlsCases
51+
* @dataProvider provideFormsUrlsCases
5252
*
5353
* @param array<string, mixed> $parameters
5454
* @param array<string, mixed> $fieldValues
@@ -71,7 +71,7 @@ public function testFormsUrls(string $url, array $parameters, string $button, ar
7171
*
7272
* @phpstan-return iterable<array{0: string, 1: array<string, mixed>, 2: string, 3?: array<string, mixed>}>
7373
*/
74-
public static function provideFormUrlsCases(): iterable
74+
public static function provideFormsUrlsCases(): iterable
7575
{
7676
yield 'Create Tag' => ['/admin/tests/app/tag/create', [
7777
'uniqid' => 'tag',

0 commit comments

Comments
 (0)