-
-
Notifications
You must be signed in to change notification settings - Fork 115
Add PHP-CS-Fixer rules for PHPUnit attributes #196
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
Add PHP-CS-Fixer rules for PHPUnit attributes #196
Conversation
Configure php_unit_test_annotation and php_unit_attributes rules to enforce modern PHPUnit attribute syntax and remove test prefixes from methods that use the #[Test] attribute.
|
|
||
| #[Test] | ||
| public function testGetMetadataNotExistingClass(): void | ||
| public function getMetadataNotExistingClass(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's strange to me, it blurs the line between test cases and helper methods
we should also consider making the practices on symfony/symfony and symfoyn/ai converge
this looks diverging here to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Having a void method with a get name prefix feels espcially weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is mostly about (not) having the test* prefix in the method name, not about the void, right?
i don't have a real preference other than being more used to having the prefix over the attribute, but mostly care about streamlining here :)
@OskarStark any hard feelings about going the symfony/symfony way here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is mostly about (not) having the
test*prefix in the method name
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the new method names are confusing.
I don't think using the Test attribute makes things better.
|
Closed in favor of #214 |
This PR was merged into the main branch. Discussion ---------- Replace #[Test] attribute by test prefix | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | | License | MIT Replacing #196 | Component | `main` | `test-prefix` | | | ---------- | ------ | -------------- | - | | Agent |105 tests, 287 assertions | 105 tests, 287 assertions | ✔️ | | AI Bundle | 14 tests, 34 assertions | 14 tests, 34 assertions | ✔️ | | MCP Bundle | no tests | still no tests | 😞 | | MCP SDK | 23 tests, 57 assertions | 23 tests, 57 assertions | ✔️ | | Platform | 381 tests, 801 assertions | 381 tests, 801 assertions | ✔️ | | Store | 90 tests, 411 assertions | 90 tests, 411 assertions | ✔️ | Commits ------- 2f7320d Replace #[Test] attribute by test prefix
Configure php_unit_test_annotation and php_unit_attributes rules to enforce modern PHPUnit attribute syntax and remove test prefixes from methods that use the #[Test] attribute.
cc @valtzu