Skip to content

Conversation

@samsonasik
Copy link
Member

@TimelessTron this should ensure only remove when attribute group added.

Ref rectorphp/rector#9183 (comment)

@samsonasik
Copy link
Member Author

It seems cause phpunit notice:

https://github.com/rectorphp/rector-phpunit/actions/runs/15180236245/job/42688052509?pr=494#step:5:35

@TimelessTron could you verify the use of @covers ::__construct on class level is correct, if no, we can just remove it as it won't be changed to attribute anyway

@samsonasik
Copy link
Member Author

Let's remove @covers ::__construct on class level, it should be on method if needed.

@samsonasik
Copy link
Member Author

@TimelessTron I tested manually on phpunit 10, and it seems still remove whole @covers

+     #[\PHPUnit\Framework\Attributes\CoversClass(\App\SomeException::class)]
      final class SomeTraitTest extends TestCase
      {
-        /**
-         * @covers \App\OtherStuff::Inject
-         * @covers \App\SomeException
-         */
-         public function testYourThinks(): void
+        public function testYourThinks(): void
          {}

Comment on lines 306 to 308
if (str_contains($desiredTagValueNode->value->value, '::') && ! $this->reflectionProvider->hasClass(self::COVERS_METHOD_ATTRIBUTE)) {
continue;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this one seems can cover it, I am thinking of moving CoversTrait and CoversMethod to phpunit 11 rule tho, but that will be need in separate PR

@samsonasik
Copy link
Member Author

I rolled back remove @covers ::__construct on class level to avoid regression 7da389b

@samsonasik
Copy link
Member Author

Let's merge so we have faster feedback.

@samsonasik samsonasik enabled auto-merge (squash) May 22, 2025 07:53
@samsonasik
Copy link
Member Author

Github status is delay https://www.githubstatus.com/

@samsonasik samsonasik closed this May 22, 2025
auto-merge was automatically disabled May 22, 2025 08:17

Pull request was closed

@samsonasik samsonasik reopened this May 22, 2025
@samsonasik samsonasik enabled auto-merge (squash) May 22, 2025 08:17
@samsonasik samsonasik merged commit b430be2 into main May 22, 2025
8 of 12 checks passed
@samsonasik samsonasik deleted the only-remove branch May 22, 2025 09:31
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