Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Update tests to use attributes for data providers #20237

Closed
wants to merge 3 commits into from

Conversation

javiereguiluz
Copy link
Member

Fixes #20202.

@javiereguiluz javiereguiluz added this to the 7.2 milestone Sep 19, 2024
@carsonbot carsonbot changed the title [Testing] Update tests to use attributes for data providers [Testing] Update tests to use attributes for data providers Sep 19, 2024
best_practices.rst Outdated Show resolved Hide resolved
.. note::

The ``#[DataProvider]`` attribute is available in PHPUnit 10 and later versions.
In previous versions, use the ``@dataProvider`` PHPdoc annotation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In previous versions, use the ``@dataProvider`` PHPdoc annotation.
In previous versions, use the ``@dataProvider`` PHPDoc annotation.

To make DOCtor-RST happy :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Fixed. Thanks.

@javiereguiluz
Copy link
Member Author

Let's ask @symfony/docs folks if they agree on using PHPUnit 10+ in 7.2 branch ... or if they prefer to wait ... or even if they prefer to use it in earlier branches. Thanks.

@javiereguiluz javiereguiluz added the Waiting team decision Request for comments from Symfony Docs Team members label Sep 24, 2024
@wouterj
Copy link
Member

wouterj commented Sep 24, 2024

I think our focus should be to be consistent with the PHPunit version across the documentation.

And the main thing is then deprecation handling (e.g. https://symfony.com/doc/current/setup/upgrade_major.html#deprecations-in-phpunit). This means we should at least switch to PHPunit 11.3 and update articles like that one to use PHPunit's error handling features. If we do this, I think it's OK to keep using PHPunit 9 (with a big warning admonition) for the PhpUnitBridge documentation until we support it (probably in 7.3 or 7.4).

For me, it's either that or keep using PHPunit 9 until we have support for PHPunit 11.3+ in the PhpUnitBridge. I don't see much value in only updating this attribute.

@javiereguiluz
Copy link
Member Author

OK, let's close this without merging and let's update PHPUnit to 11 in Symfony 7.3 or 7.4/8.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Testing Waiting team decision Request for comments from Symfony Docs Team members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants