Skip to content
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

[Msrp] Cover MsrpPriceCalculator by Unit Test #26067

Conversation

edenduong
Copy link
Contributor

Description (*)

Increase Test Coverage by Cover class Magento\Msrp\Pricing\MsrpPriceCalculator

  • getMsrpPriceValue with dataset

Fixed Issues (if relevant)

Manual testing scenarios (*)

vendor/bin/phpunit app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@edenduong edenduong requested a review from akaplya as a code owner December 16, 2019 16:15
@m2-assistant
Copy link

m2-assistant bot commented Dec 16, 2019

Hi @edenduong. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

namespace Magento\Msrp\Test\Unit\Pricing;

use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Type as Type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this alias is relevant :)

Suggested change
use Magento\Catalog\Model\Product\Type as Type;
use Magento\Catalog\Model\Product\Type as ProductType;

*/
public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected)
{
$objectManager = new ObjectManager($this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the object manager along with testable object initialization to the setUp method. No need to initialize them for each test case triggered.
Thus, it can be also used in further tests if necessary.

@edenduong
Copy link
Contributor Author

Hi @dmytro-ch: Thank you for your feedback. I have changed the source code. Please check it again.

Thanks.

@engcom-Delta
Copy link
Contributor

Notice: QA not applicable

@m2-assistant
Copy link

m2-assistant bot commented Dec 18, 2019

Hi @edenduong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants