Skip to content

Commit 9679844

Browse files
Fix
1 parent 7625e2e commit 9679844

6 files changed

Lines changed: 20 additions & 26 deletions

File tree

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
"knplabs/knp-menu": "^3.0",
5050
"knplabs/knp-menu-bundle": "^3.0",
5151
"masterminds/html5": "^2.7",
52-
"matthiasnoback/symfony-config-test": "^4.2 || ^5.1",
53-
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
52+
"matthiasnoback/symfony-config-test": "^6.1",
53+
"matthiasnoback/symfony-dependency-injection-test": "^6.1",
5454
"phpstan/extension-installer": "^1.0",
5555
"phpstan/phpdoc-parser": "^1.0",
5656
"phpstan/phpstan": "^1.0 || ^2.0",
5757
"phpstan/phpstan-phpunit": "^1.0 || ^2.0",
5858
"phpstan/phpstan-strict-rules": "^1.0 || ^2.0",
5959
"phpstan/phpstan-symfony": "^1.0 || ^2.0",
60-
"phpunit/phpunit": "^9.5",
60+
"phpunit/phpunit": "^10.5.54 || ^11.5.38 || ^12.3.10",
6161
"psalm/plugin-phpunit": "^0.18 || ^0.19",
6262
"psalm/plugin-symfony": "^5.0",
6363
"rector/rector": "^1.1 || ^2.0",
@@ -67,7 +67,6 @@
6767
"symfony/asset": "^6.4 || ^7.1",
6868
"symfony/browser-kit": "^6.4 || ^7.1",
6969
"symfony/filesystem": "^6.4 || ^7.1",
70-
"symfony/phpunit-bridge": "^6.4 || ^7.1",
7170
"symfony/security-bundle": "^6.4 || ^7.1",
7271
"symfony/security-csrf": "^6.4 || ^7.1",
7372
"symfony/twig-bundle": "^6.4 || ^7.1",

tests/Controller/CategoryAdminControllerTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Controller;
1515

16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use PHPUnit\Framework\MockObject\MockObject;
1718
use PHPUnit\Framework\TestCase;
1819
use Psr\Container\ContainerInterface;
@@ -172,9 +173,7 @@ public function testListActionWithoutFilter(): void
172173
static::assertSame('tree?hide_context=0', $result->getTargetUrl());
173174
}
174175

175-
/**
176-
* @dataProvider provideListActionCases
177-
*/
176+
#[DataProvider('provideListActionCases')]
178177
public function testListAction(string|false $context): void
179178
{
180179
$contextValue = false === $context ? '' : $context;
@@ -219,17 +218,16 @@ public function testListAction(string|false $context): void
219218
/**
220219
* @return iterable<string, array{string|false}>
221220
*/
222-
public function provideListActionCases(): iterable
221+
public static function provideListActionCases(): iterable
223222
{
224223
yield 'context' => ['default'];
225224
yield 'no context' => [false];
226225
}
227226

228227
/**
229-
* @dataProvider provideTreeActionCases
230-
*
231228
* @param array<array{string, string}> $categories
232229
*/
230+
#[DataProvider('provideTreeActionCases')]
233231
public function testTreeAction(string|false $context, array $categories): void
234232
{
235233
$datagrid = $this->createMock(DatagridInterface::class);
@@ -290,7 +288,7 @@ public function testTreeAction(string|false $context, array $categories): void
290288
/**
291289
* @return iterable<string, array{string|false, array<array{string, string}>}>
292290
*/
293-
public function provideTreeActionCases(): iterable
291+
public static function provideTreeActionCases(): iterable
294292
{
295293
yield 'context and no categories' => ['default', []];
296294
yield 'no context and no categories' => [false, []];

tests/Functional/Admin/CategoryAdminTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Functional\Admin;
1515

16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use Doctrine\ORM\EntityManagerInterface;
1718
use Sonata\ClassificationBundle\Tests\App\Entity\Category;
1819
use Sonata\ClassificationBundle\Tests\App\Entity\Context;
@@ -22,9 +23,8 @@ final class CategoryAdminTest extends WebTestCase
2223
{
2324
/**
2425
* @param array<string, mixed> $parameters
25-
*
26-
* @dataProvider provideCrudUrlsCases
2726
*/
27+
#[DataProvider('provideCrudUrlsCases')]
2828
public function testCrudUrls(string $url, array $parameters = []): void
2929
{
3030
$client = self::createClient();
@@ -57,11 +57,11 @@ public static function provideCrudUrlsCases(): iterable
5757
}
5858

5959
/**
60-
* @dataProvider provideFormsUrlsCases
6160
*
6261
* @param array<string, mixed> $parameters
6362
* @param array<string, mixed> $fieldValues
6463
*/
64+
#[DataProvider('provideFormsUrlsCases')]
6565
public function testFormsUrls(string $url, array $parameters, string $button, array $fieldValues = []): void
6666
{
6767
$client = self::createClient();

tests/Functional/Admin/CollectionAdminTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Functional\Admin;
1515

16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use Doctrine\ORM\EntityManagerInterface;
1718
use Sonata\ClassificationBundle\Tests\App\Entity\Collection;
1819
use Sonata\ClassificationBundle\Tests\App\Entity\Context;
1920
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2021

2122
final class CollectionAdminTest extends WebTestCase
2223
{
23-
/**
24-
* @dataProvider provideCrudUrlsCases
25-
*/
24+
#[DataProvider('provideCrudUrlsCases')]
2625
public function testCrudUrls(string $url): void
2726
{
2827
$client = self::createClient();
@@ -48,11 +47,11 @@ public static function provideCrudUrlsCases(): iterable
4847
}
4948

5049
/**
51-
* @dataProvider provideFormsUrlsCases
5250
*
5351
* @param array<string, mixed> $parameters
5452
* @param array<string, mixed> $fieldValues
5553
*/
54+
#[DataProvider('provideFormsUrlsCases')]
5655
public function testFormsUrls(string $url, array $parameters, string $button, array $fieldValues = []): void
5756
{
5857
$client = self::createClient();

tests/Functional/Admin/ContextAdminTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Functional\Admin;
1515

16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use Doctrine\ORM\EntityManagerInterface;
1718
use Sonata\ClassificationBundle\Tests\App\Entity\Context;
1819
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
1920

2021
final class ContextAdminTest extends WebTestCase
2122
{
22-
/**
23-
* @dataProvider provideCrudUrlsCases
24-
*/
23+
#[DataProvider('provideCrudUrlsCases')]
2524
public function testCrudUrls(string $url): void
2625
{
2726
$client = self::createClient();
@@ -47,11 +46,11 @@ public static function provideCrudUrlsCases(): iterable
4746
}
4847

4948
/**
50-
* @dataProvider provideFormsUrlsCases
5149
*
5250
* @param array<string, mixed> $parameters
5351
* @param array<string, mixed> $fieldValues
5452
*/
53+
#[DataProvider('provideFormsUrlsCases')]
5554
public function testFormsUrls(string $url, array $parameters, string $button, array $fieldValues = []): void
5655
{
5756
$client = self::createClient();

tests/Functional/Admin/TagAdminTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Functional\Admin;
1515

16+
use PHPUnit\Framework\Attributes\DataProvider;
1617
use Doctrine\ORM\EntityManagerInterface;
1718
use Sonata\ClassificationBundle\Tests\App\Entity\Context;
1819
use Sonata\ClassificationBundle\Tests\App\Entity\Tag;
1920
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2021

2122
final class TagAdminTest extends WebTestCase
2223
{
23-
/**
24-
* @dataProvider provideCrudUrlsCases
25-
*/
24+
#[DataProvider('provideCrudUrlsCases')]
2625
public function testCrudUrls(string $url): void
2726
{
2827
$client = self::createClient();
@@ -48,11 +47,11 @@ public static function provideCrudUrlsCases(): iterable
4847
}
4948

5049
/**
51-
* @dataProvider provideFormsUrlsCases
5250
*
5351
* @param array<string, mixed> $parameters
5452
* @param array<string, mixed> $fieldValues
5553
*/
54+
#[DataProvider('provideFormsUrlsCases')]
5655
public function testFormsUrls(string $url, array $parameters, string $button, array $fieldValues = []): void
5756
{
5857
$client = self::createClient();

0 commit comments

Comments
 (0)