8000 Add failing test fixture for `StaticDataProviderClassMethodRector` with ignored abstract parent test case by OskarStark · Pull Request #160 · rectorphp/rector-phpunit · GitHub
[go: up one dir, main page]

Skip to content

Add failing test fixture for StaticDataProviderClassMethodRector with ignored abstract parent test case #160

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.

8000

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 11, 2023

Failing Test for StaticDataProviderClassMethodRector

Based on https://getrector.com/demo/9372e294-4277-4bb9-abeb-34764c0b053c

Explanation

Because the parent abstract class is skipped in rector config, their child classes should be ignored for this rector as well. Check the demo link please, thanks.

This test should be failing ❗

Spotted in

@OskarStark OskarStark changed the title Add failing test fixture for StaticDataProviderClassMethodRector Add failing test fixture for StaticDataProviderClassMethodRector with ignored abstract parent test case Feb 11, 2023
@TomasVotruba
Copy link
Member

This is identical to already fixed #156

How is it different?

@TomasVotruba TomasVotruba mentioned this pull request Feb 11, 2023
@OskarStark
Copy link
Contributor Author

CleanShot 2023-02-11 at 13 23 22@2x

I told rector to skip the abstract class, which cannot be reflected in the failing test case

@TomasVotruba
Copy link
Member

I see. It only works for explicit paths, no magic :)

Also, the __DIR__ . 'String might result into SomePathString

@TomasVotruba
Copy link
Member

Btw, what is reason to ignore any files here? The upgrade must handle all files.

@OskarStark
Copy link
Contributor Author

In Symfony all abstract cases in /Test/ namespace are under BC promise and can be used in username. All abstract testcases in /Tests/ namespace are considered internal and are only used for our codebase, which we can change but the ones in /Test/ need to have an upgrade path including deprecations we need to find manually.

But ofc our own tests in /Test/ are using the abstract testcases from /Test/

I hope I make it clear 😃 thanks for your time

@TomasVotruba
Copy link
Member

I see :) That's super specific use case that would be only useful for Symfony core project.

I think for that would be best just to fork Rector rule to custom one and apply this logic there.

@OskarStark OskarStark deleted the patch-1 branch February 11, 2023 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0