You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a custom PHPStan rule for my team to validate the correct usage of test classes. This rule checks if a test class is using any methods from its immediate parent class. If not, it suggests inheriting from a more appropriate parent class.
Specifically, it validates test classes that extend:
We implemented this rule because in our large team, many developers were writing tests that weren't optimally structured, leading to slower pipeline execution. This rule helps ensure tests are written using the most efficient base class.
If this idea aligns with the project's goals, I'd be happy to refine the code of my custom rule and submit a pull request to phpstan-symfony, potentially for the 2.1.0 release.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered:
Hello,
I've been working on a custom PHPStan rule for my team to validate the correct usage of test classes. This rule checks if a test class is using any methods from its immediate parent class. If not, it suggests inheriting from a more appropriate parent class.
Specifically, it validates test classes that extend:
For example, if a test class extends Symfony\Bundle\FrameworkBundle\Test\KernelTestCase but doesn't use any of its methods, the rule would report an error and suggest trying PHPUnit\Framework\TestCase instead.
We implemented this rule because in our large team, many developers were writing tests that weren't optimally structured, leading to slower pipeline execution. This rule helps ensure tests are written using the most efficient base class.
If this idea aligns with the project's goals, I'd be happy to refine the code of my custom rule and submit a pull request to phpstan-symfony, potentially for the 2.1.0 release.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: