[GH-ISSUE #1677] Rename TestCase class to something else to improve developer experience #716

Closed
opened 2026-03-04 02:17:20 +03:00 by kerem · 7 comments
Owner

Originally created by @alexander-schranz on GitHub (May 25, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1677

I'm not sure why but PHPStorm begins to suggest me always the Monolog TestCase class instead of PHPUnit TestCase class. Was it in the past not part of the export? Not sure even strange that it begins now always be the first entry in the suggest list:

Bildschirmfoto 2022-05-25 um 16 52 48

There was similar issue with PHPStan https://github.com/phpstan/phpstan-src/pull/634 where PHPStan decided to change the class for Developer Experience, maybe we can do the same here. Sadly it seems I'm little bit late as 3.0 was released shortly :/. But maybe we can already do some changes for a future 4.0 🤔.

Originally created by @alexander-schranz on GitHub (May 25, 2022). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1677 I'm not sure why but PHPStorm begins to suggest me always the Monolog TestCase class instead of PHPUnit TestCase class. Was it in the past not part of the export? Not sure even strange that it begins now always be the first entry in the suggest list: ![Bildschirmfoto 2022-05-25 um 16 52 48](https://user-images.githubusercontent.com/1698337/170293363-b4e3cc11-0809-4678-9be6-2fd6cbb12769.png) There was similar issue with PHPStan https://github.com/phpstan/phpstan-src/pull/634 where PHPStan decided to change the class for Developer Experience, maybe we can do the same here. Sadly it seems I'm little bit late as 3.0 was released shortly :/. But maybe we can already do some changes for a future 4.0 🤔.
kerem 2026-03-04 02:17:20 +03:00
  • closed this issue
  • added the
    Feature
    label
Author
Owner

@stof commented on GitHub (May 25, 2022):

It is part of the package since 2.0

<!-- gh-comment-id:1137406115 --> @stof commented on GitHub (May 25, 2022): It is part of the package since 2.0
Author
Owner

@alexander-schranz commented on GitHub (May 30, 2022):

I see maybe was locked to monolog 1 until yet 🤔

<!-- gh-comment-id:1141248106 --> @alexander-schranz commented on GitHub (May 30, 2022): I see maybe was locked to monolog 1 until yet 🤔
Author
Owner

@Seldaek commented on GitHub (Jun 8, 2022):

Yeah I can see this sucks, but it seems more like a PHPStorm issue than something that can be fixed here.. Tons of packages expose a TestCase class/file, it should really prefer the PHPUnit one unless you have a local TestCase class in the project itself (which it already seems to prefer unless I'm mistaken).

Only thing I can think of is to mark it internal, which may help PHPStorm, but will also nag anyone relying on the class in third party extensions, which may be an ok trade-off. Can you try if adding @internal fixes it for you?

<!-- gh-comment-id:1150360702 --> @Seldaek commented on GitHub (Jun 8, 2022): Yeah I can see this sucks, but it seems more like a PHPStorm issue than something that can be fixed here.. Tons of packages expose a TestCase class/file, it should really prefer the PHPUnit one unless you have a local TestCase class in the project itself (which it already seems to prefer unless I'm mistaken). Only thing I can think of is to mark it internal, which may help PHPStorm, but will also nag anyone relying on the class in third party extensions, which may be an ok trade-off. Can you try if adding `@internal` fixes it for you?
Author
Owner

@mfn commented on GitHub (Jun 9, 2022):

@alexander-schranz maybe also try on https://youtrack.jetbrains.com/ directly on the PhpStorm team

<!-- gh-comment-id:1150787468 --> @mfn commented on GitHub (Jun 9, 2022): @alexander-schranz maybe also try on https://youtrack.jetbrains.com/ directly on the PhpStorm team
Author
Owner

@alexander-schranz commented on GitHub (Jun 9, 2022):

@Seldaek Yes the @internal would work:

test-case-monolog

@mfn created an issue here: https://youtrack.jetbrains.com/issue/WI-67050/Auto-Completion-should-prefer-PHPUnit-TestCase-over-other-third-party-TestCase-classes

<!-- gh-comment-id:1150832910 --> @alexander-schranz commented on GitHub (Jun 9, 2022): @Seldaek Yes the `@internal` would work: ![test-case-monolog](https://user-images.githubusercontent.com/1698337/172799421-36e6f7f4-8b3f-4983-9246-e54987e11f7a.gif) @mfn created an issue here: https://youtrack.jetbrains.com/issue/WI-67050/Auto-Completion-should-prefer-PHPUnit-TestCase-over-other-third-party-TestCase-classes
Author
Owner

@stof commented on GitHub (Jun 9, 2022):

Tons of packages expose a TestCase class/file, it should really prefer the PHPUnit one unless you have a local TestCase class in the project itself (which it already seems to prefer unless I'm mistaken).

I don't think tons of package expose it. Many package have one in their testsuite. But as of Monolog 2, it is part of the package itself, not of the testsuite (and so not excluded from the archive). I think most packages exposing a reusable base testcase give it a name describing it.

<!-- gh-comment-id:1150837813 --> @stof commented on GitHub (Jun 9, 2022): > Tons of packages expose a TestCase class/file, it should really prefer the PHPUnit one unless you have a local TestCase class in the project itself (which it already seems to prefer unless I'm mistaken). I don't think tons of package expose it. Many package have one in their testsuite. But as of Monolog 2, it is part of the package itself, not of the testsuite (and so not excluded from the archive). I think most packages exposing a reusable base testcase give it a name describing it.
Author
Owner

@alexander-schranz commented on GitHub (Jun 9, 2022):

@Seldaek Thank you!

<!-- gh-comment-id:1150850147 --> @alexander-schranz commented on GitHub (Jun 9, 2022): @Seldaek Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#716
No description provided.