Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make the data provider itself static, thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @dataProvider provideInvalidConstraints

Could also be updated ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamirault shall we create a DOCtor rule for using phpunit attributes and search and report the most common ones?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did this update while merging. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamirault shall we create a DOCtor rule for using phpunit attributes and search and report the most common ones?

Not yet, not enough occurrence

public function testPageIsSuccessful($url): void
{
$client = self::createClient();
Expand All @@ -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'];
Expand Down
Loading