Skip to content

Commit 6cc5b9c

Browse files
ttkjaviereguiluz
authored andcommitted
Replace PHPDoc dataProvider with attribute syntax
1 parent 3b6b704 commit 6cc5b9c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

best_practices.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,12 @@ checks that all application URLs load successfully::
403403
// tests/ApplicationAvailabilityFunctionalTest.php
404404
namespace App\Tests;
405405

406+
use PHPUnit\Framework\Attributes\DataProvider;
406407
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
407-
408+
408409
class ApplicationAvailabilityFunctionalTest extends WebTestCase
409410
{
410-
/**
411-
* @dataProvider urlProvider
412-
*/
411+
#[DataProvider('urlProvider')]
413412
public function testPageIsSuccessful($url): void
414413
{
415414
$client = self::createClient();
@@ -418,7 +417,7 @@ checks that all application URLs load successfully::
418417
$this->assertResponseIsSuccessful();
419418
}
420419

421-
public function urlProvider(): \Generator
420+
public static function urlProvider(): \Generator
422421
{
423422
yield ['/'];
424423
yield ['/posts'];

0 commit comments

Comments
 (0)