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
Bugfix issue #5163 #5236
Bugfix issue #5163 #5236
Conversation
src/Codeception/Step.php
Outdated
@@ -173,7 +174,7 @@ protected function getClassName($argument) | |||
{ | |||
if ($argument instanceof \Closure) { | |||
return 'Closure'; | |||
} elseif ((isset($argument->__mocked))) { | |||
} elseif (in_array(MockObject::class, class_implements(get_class($argument)))) { |
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.
Why not use instanceof
?
Fix suggestion commit
LGTM, will merge when tests finish. |
New github feature is cool but it seems they have a bug :) |
@@ -173,7 +174,7 @@ protected function getClassName($argument) | |||
{ | |||
if ($argument instanceof \Closure) { | |||
return 'Closure'; | |||
} elseif ((isset($argument->__mocked))) { | |||
} elseif ($argument instanceof MockObject) { | |||
return $this->formatClassName($argument->__mocked); |
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.
Ok, what if there is no __mocked
property but an object is still MockObject?
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.
@DavertMik Have applied changes as requested but AppVeyor build failed (it looks like AppVeyor error)
elseif ($argument instanceof MockObject && isset($argument->__mocked)
are you happy with this?
Please don't mark the PR with [Yii] if it's not Yii related. |
I think the better way is to remove |
@DavertMik Below is the AppVeyor error. Is there a way to re-trigger the build?
|
Sorry, not familiar with AppVeyor |
@DavertMik Are you able to have a look at this and review? I understand @SamMousa suggested removing
__mocked
property but not sure if that's would be an "easy fix", so just checking if class is implementingPHPUnit\Framework\MockObject\MockObject
interface.Closes #5163