Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PHPUnit 10] Use TestCase suffix for abstract tests in /Tests/ #49234

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

Closed
wants to merge 1 commit into from

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Feb 4, 2023

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Tickets Refs #49233
License MIT
Doc PR -

Using Test suffix is deprecated since PHPUnit 10

Spotted in

cc @derrabus

@carsonbot carsonbot added this to the 5.4 milestone Feb 4, 2023
@OskarStark OskarStark changed the title [PHPUnit 10] Use TestCase suffix for abstract tests [PHPUnit 10] Use TestCase suffix for abstract tests in /Tests/ Feb 4, 2023
@OskarStark
Copy link
Contributor Author

Should be good now @xabbuh

Using `Test` suffix is deprecated since PHPUnit 10

Spotted in
* symfony#49233
@@ -1,13 +1,13 @@
<?php

use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTest;
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
Copy link
Member

Choose a reason for hiding this comment

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

the class name is used in the XML and YAML fixtures too

@xabbuh
Copy link
Member

xabbuh commented Feb 4, 2023

Search the codebase with abstract class .+Test extends I also find some more classes that probably need to be updated as well.

@derrabus
Copy link
Member

derrabus commented Feb 4, 2023

Since we're changing the names of a lot of classes anyway, shall we make the naming a bit more consitent? We have AbstractSomethingTestCase, BaseSomethingTestCase, SomethingTestCase, …

I think, SomethingTestCase is the pattern that we use for our reusable test case classes already (WebTestCase, KernelTestCase, …). Would it make sense to use that pattern everywhere?

@nicolas-grekas
Copy link
Member

What about doing this on 6.3. We can continue using phpunit 9 for the time being on 5.4.

@OskarStark
Copy link
Contributor Author

@xabbuh but aren't these classes in /Test/ which follows BC?

@derrabus open for the renaming of others agree

@nicolas-grekas we are doing the other PHPUnit stuff against 5.4, but how you like

@fabpot
Copy link
Member

fabpot commented Feb 4, 2023

I don't have a strong opinion, but I think we shouldn't do it on 5.4.

@OskarStark
Copy link
Contributor Author

Let's go with 6.3 then 👍🏻🤓

@wouterj
Copy link
Member

wouterj commented Feb 4, 2023

Agreed, this is a feature according to our policies:

The following changes are never accepted in a patch version:

  • ...
  • Support for newer major versions of Composer dependencies

@wouterj wouterj modified the milestones: 5.4, 6.3 Feb 4, 2023
@OskarStark
Copy link
Contributor Author

Per se it's just a renaming of an internal class, so the policy does not match here from my POV.

The one why I thought it makes sense to use 5.4 is to avoid merge conflicts.

But as I said, ok let's go with 6.3

But what about the static data providers and the open PR from @xabbuh ?

@OskarStark
Copy link
Contributor Author

OskarStark added a commit to OskarStark/symfony that referenced this pull request Feb 6, 2023
Replaces symfony#49234

Using `Test` suffix is deprecated since PHPUnit 10

Spotted in
* symfony#49233
@OskarStark
Copy link
Contributor Author

@OskarStark OskarStark closed this Feb 6, 2023
@OskarStark OskarStark deleted the suffix-testcase branch February 6, 2023 05:25
OskarStark added a commit to OskarStark/symfony that referenced this pull request Feb 7, 2023
Replaces symfony#49234

Using `Test` suffix is deprecated since PHPUnit 10

Spotted in
* symfony#49233
@derrabus
Copy link
Member

derrabus commented Feb 7, 2023

What about doing this on 6.3. We can continue using phpunit 9 for the time being on 5.4.

Late to the party here. 🙈

We can go for 6.3 for this change, but that means we need to silence the deprecation regarding those classes on 5.4. We should run the tests on the 5.4 branch with PHPUnit 9.6 because 9.5 likely won't receive fixes for PHP 8.3/8.4.

nicolas-grekas added a commit that referenced this pull request Feb 7, 2023
… `/Tests/` (OskarStark)

This PR was merged into the 6.3 branch.

Discussion
----------

[PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/`

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Refs #49233
| License       | MIT
| Doc PR        | n/a

Replaces #49234

Using `Test` suffix is deprecated since PHPUnit 10

Spotted in
* #49233

Commits
-------

cb3db96 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/`
nicolas-grekas added a commit that referenced this pull request Feb 7, 2023
… `/Tests/` (OskarStark)

This PR was merged into the 6.3 branch.

Discussion
----------

[PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/`

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Refs #49233
| License       | MIT
| Doc PR        | n/a

Replaces #49234

Using `Test` suffix is deprecated since PHPUnit 10

Spotted in
* #49233

Commits
-------

cb3db96 [PHPUnit 10] Use `TestCase` suffix for abstract tests in `/Tests/`
@nicolas-grekas
Copy link
Member

@derrabus makes sense. I've cherry-picked #49253 on 5.4 in aec2271

@xabbuh
Copy link
Member

xabbuh commented Feb 17, 2023

@OskarStark see #49419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants