-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cleanup ObjectManager usage - Magento_Catalog ViewModel,Plugin #27319
Cleanup ObjectManager usage - Magento_Catalog ViewModel,Plugin #27319
Conversation
Hi @Bartlomiejsz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
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.
Correct the tested class names (avoid generic aliases).
Add 'mock' suffix to mocked properties in unit tests.
|
||
namespace Magento\Catalog\Test\Unit\Plugin\Model\ResourceModel; | ||
|
||
use Magento\Catalog\Model\ResourceModel\Config as Subject; |
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.
Avoid using subject as it's misleading.
Use ConfigResourceModel instead
/** @var SerializerInterface|\PHPUnit_Framework_MockObject_MockObject */ | ||
/** | ||
* @var SerializerInterface|MockObject | ||
*/ | ||
private $serializer; |
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.
Suffix with 'mock'
efbbb9f
to
d634cac
Compare
@lbajsarowicz applied fixes for review comments, please review |
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.
✔️ Thank you for your contribution
Hi @lbajsarowicz, thank you for the review.
|
✔️ QA Passed |
@magento run Functional Tests EE |
Hi @Bartlomiejsz, thank you for your contribution! |
Description (*)
This PR cleanups ObjectManager usage in Magento_Catalog ViewModel and Plugin, by removing object manager instantiation from non-api classes. This is first part of #27135 split into smaller chunks to proceed it easily.
Related Pull Requests
Fixed Issues (if relevant)
N/A
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)