-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Make TestCase
methods final
that should have been final
all along
#5254
Comments
TestCase
methods final
that should have been final
all along
I'm begging you not to do this. Laravel very much relies on these methods, especially |
Allowing to override Can you explain why you currently override |
Thank you for considering it! For Laravel's HTTP testing we check if there's a latest response: If that's the case we'll transform the exception to provide more info depending on what type of response it is: |
Would this help? WIP: Implement
|
@sebastianbergmann yes that would be useful. Previously we used |
@sebastianbergmann yes that would solve this! Thank you 🙂 |
|
Reconsider? If your concern with these not being final is people's application's breaking if they override them, create a GitHub saved reply explaining you override those methods at your own risk and any breakages from doing so are not your problem and close the issue? |
#[Override]
protected function runTest(): mixed
{
// CI systems like GitHub Actions set the CI environment variable
if (getenv('CI')) {
return retry(3, function () {
return parent::runTest();
});
}
return parent::runTest();
} We were using Do you have any suggestions on what we can override now to have this behaviour? I have dug into the source code of PHPUnit 11 and have not found any methods to override easily to achieve this. |
I also use |
runTest()
iniSet()
setLocale()
createStub()
createStubForIntersectionOfInterfaces()
createMock()
createMockForIntersectionOfInterfaces()
createConfiguredMock()
createPartialMock()
createTestProxy()
getMockForAbstractClass()
getMockFromWsdl()
getMockForTrait()
getObjectForTrait()
The text was updated successfully, but these errors were encountered: