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

chore: do not perform type analysis in tests #7852

Conversation

kubawerlos
Copy link
Contributor

Related to the currently failing CI on the main branch.

@coveralls
Copy link

coveralls commented Feb 25, 2024

Coverage Status

coverage: 94.805%. remained the same
when pulling 3fe4665 on 6b7562617765726c6f73:do_not_do_static_analysis_in_phpunit
into e74af87 on PHP-CS-Fixer:master.

Copy link
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

I am in favour of this change, since I find it superfluous to make such assertions, but I think we need to wait for @keradus' opinion. I can only guess what was the reasoning and I think it's more about ensuring that our internal classes provide interface instead of being concrete-only classes. Yeah, most probably removing implements X would lead to other failures or inability to test things properly, but I guess that these are "architectural" assertions, and I won't merge this change on my own.

There's always an option to introduce tools like Arkitect or other, to ensure such design constraints are matched.

'weird'
);

self::assertInstanceOf(\InvalidArgumentException::class, $exception);
Copy link
Member

Choose a reason for hiding this comment

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

no clue why we have tests like those.
I believe they cause no harm, but also no huge benefit behind them.

IE, we rely that result of function foo(): Date is Date without making utest for result type

@keradus keradus changed the title chore: do not perform static analysis in PHPUnit chore: do not perform type analysis in tests Feb 25, 2024
@Wirone Wirone merged commit 0c28cca into PHP-CS-Fixer:master Feb 25, 2024
25 checks passed
@Wirone Wirone deleted the do_not_do_static_analysis_in_phpunit branch February 25, 2024 16:08
@Wirone
Copy link
Member

Wirone commented Feb 25, 2024

Thanks @kubawerlos 🍻!

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.

None yet

4 participants