From 6cc5b9c8c95af66dcc368d8f5a49f764261dca54 Mon Sep 17 00:00:00 2001 From: Tom Kaminski Date: Sat, 29 Nov 2025 14:08:37 -0600 Subject: [PATCH] Replace PHPDoc dataProvider with attribute syntax --- best_practices.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/best_practices.rst b/best_practices.rst index 7ca5590036a..8c797ca42f9 100644 --- a/best_practices.rst +++ b/best_practices.rst @@ -403,13 +403,12 @@ checks that all application URLs load successfully:: // tests/ApplicationAvailabilityFunctionalTest.php namespace App\Tests; + use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; - + class ApplicationAvailabilityFunctionalTest extends WebTestCase { - /** - * @dataProvider urlProvider - */ + #[DataProvider('urlProvider')] public function testPageIsSuccessful($url): void { $client = self::createClient(); @@ -418,7 +417,7 @@ checks that all application URLs load successfully:: $this->assertResponseIsSuccessful(); } - public function urlProvider(): \Generator + public static function urlProvider(): \Generator { yield ['/']; yield ['/posts'];