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

[TASK] Update the development tools #1383

Merged
merged 2 commits into from
Jan 2, 2025
Merged

[TASK] Update the development tools #1383

merged 2 commits into from
Jan 2, 2025

Conversation

oliverklee
Copy link
Contributor

No description provided.

@oliverklee oliverklee added this to the 8.0.0 milestone Dec 31, 2024
@oliverklee oliverklee requested a review from JakeQZ December 31, 2024 09:21
@oliverklee oliverklee self-assigned this Dec 31, 2024
github-actions[bot]

This comment was marked as off-topic.

@coveralls
Copy link

coveralls commented Dec 31, 2024

Coverage Status

coverage: 97.062%. remained the same
when pulling 2a4c00f on task/dev-tools
into 7827f1f on main.

Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I have a couple of questions about createStub.

Comment on lines 74 to 76
// `'methods' => ['createStub' => 'this']` is required as long as we are not on PHPUnit 10.x yet
// (where that method was made static).
'php_unit_test_case_static_method_calls' => ['call_type' => 'self', 'methods' => ['createStub' => 'this']],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised that we need this, given that we do not call createStub AFAICS, and neither does PHPUnit itself. I'm also mystified as to what change between 3.64 and 3.66 of the Fixer means that we would now need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some background on this:

PHPUnit provides two kinds of test doubles: Mocks and stubs. They work in similar ways, and using the correct type helps both the reader recognize the purpose of the corresponding test double more easily as well as PHPStan to recognize incorrect usage.

With PHPUnit version 10, the method createStub was made static.

PHP-CS-Fixer 3.66.0 introduced the feature of (by default) making calls to createStub static as well, which breaks tests that are on PHPUnit 9.x. (Up to and including version 3.65.0, PHP-CS-Fixer left calls to createStub alone AFAIK.)

As we're currently using neither getMock nor getStub, I'll remove the corresponding line from the PHP-CS-Fixer configuration to keep things simple.

We're not using `createStub` at this point (and also not
`createMock`, so let's keep the PHP-CS-Fixer configuration
simple for now.
@JakeQZ JakeQZ merged commit 5bad799 into main Jan 2, 2025
28 checks passed
@JakeQZ JakeQZ deleted the task/dev-tools branch January 2, 2025 18:50
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.

3 participants