-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Remove calls to getMockForAbstractClass()
#12003
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
base: 2.20.x
Are you sure you want to change the base?
Remove calls to getMockForAbstractClass()
#12003
Conversation
2c7607d
to
d2cbab2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
6a20f49
to
a308fec
Compare
a308fec
to
c2cdb52
Compare
$sqlExecMock->expects(self::once()) | ||
->method('execute') | ||
->willReturn(10); | ||
$sqlExecMock = new class extends AbstractSqlExecutor { |
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.
This is no longer a mock… should it be renamed to include stub or dummy?
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.
No strong opinion here… What do you prefer?
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'd say stub
$strategy = new DefaultQuoteStrategy(); | ||
$platform = $this->getMockForAbstractClass(AbstractPlatform::class); | ||
assert($platform instanceof AbstractPlatform); | ||
$platform = $this->createMock(AbstractPlatform::class); |
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.
We seem to have a polyfill for createStub
in DoctrineTestCase
, let's use it, here and below?
PHPUnit has deprecated partial mocking, so we should avoud calling
getMockForAbstractClass()
in our tests.