-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
#[IgnorePHPUnitWarnings]
attribute for ignoring PHPUnit warnings
#6268
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
#[IgnorePHPUnitWarnings]
attribute for ignoring PHPUnit warnings
#6268
Conversation
966ce2c
to
0e6020d
Compare
Looks good, thank you. I will merge once you're ready. |
5b7a797
to
226a7c3
Compare
@@ -1008,6 +1011,17 @@ public function testTriggeredPhpunitError(Code\Test $test, string $message): voi | |||
*/ | |||
public function testTriggeredPhpunitWarning(Code\Test $test, string $message): void | |||
{ | |||
if ( | |||
$test->isTestMethod() && | |||
class_exists($test->className()) && |
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.
Is the call to class_exists()
really needed? I do not see how we could have a Code\Test $test
object where $test->className()
returns a string that is not the name of a class that exists.
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've added it because the test DispatchingEmitterTest::testTestTriggeredPhpunitWarningEmitsTestPhpunitWarningTriggeredEvent
uses a classname that does not exist
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 think that otherwise, we should use existing classes/methods here
226a7c3
to
c14fba9
Compare
c2ef009
to
735d011
Compare
@sebastianbergmann ready! 😊 |
#[IgnorePHPUnitWarnings]
#[IgnorePHPUnitWarnings]
attribute for ignoring PHPUnit warnings
This is a follow up PR of this discussion
I hope the involved complexity is not too high. I was actually pleasantly surprised how easy it was
Please, could you tell me what's your feeling about the implementation, if you're okay to go, I'll add some missing unit tests.
thanks!