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

#11209 Wishlist Add grouped product Error #26258

Conversation

MaxRomanov4669
Copy link
Contributor

@MaxRomanov4669 MaxRomanov4669 commented Jan 4, 2020

Description (*)

Fixed Wishlist logic for grouped products when add same simple product

Fixed Issues (if relevant)

  1. Wishlist Add grouped product Error #11209: Wishlist Add grouped product Error

Manual testing scenarios (*)

  1. Go to the grouped product page.
  2. Set qty for one of the simple products
  3. click add to wishlist
  4. Go to grouped product page and add same simple product with different qty to the wishlist
  5. check number of grouped products in the wishlist and check Option Details in grouped product

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)

@m2-assistant
Copy link

m2-assistant bot commented Jan 4, 2020

Hi @MaxRomanov4669. 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.

@rogyar rogyar self-assigned this Jan 5, 2020
@rogyar rogyar added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 5, 2020
Copy link
Contributor

@rogyar rogyar left a comment

Choose a reason for hiding this comment

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

Hi @MaxRomanov4669.
Thank you for your collaboration. Also, please, take a look at the failing static tests. It looks like there's one missing dependency in the composer.json

$diff = array_diff_key($options1, $options2);

if (!$diff) {
foreach ($options1 as $key => $val) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, use something like

foreach(array_keys($options) as $key) { ...

To avoid unused variables declaration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

* @return array
*/
public function beforeCompareOptions(
WishlistItem $subject,
Copy link
Contributor

Choose a reason for hiding this comment

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

You may use @SuppressWarnings(PHPMD.UnusedFormalParameter) in case of this method if the $subject variable is unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


$superGroupObj = new \Magento\Framework\DataObject($superGroup);

$this->productMock->expects($this->once())->method('getId')->willReturn(34);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, assign repetitive values (34 and others) to a separate variable. It will make the code easier to maintain in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@rogyar
Copy link
Contributor

rogyar commented Jan 9, 2020

Hi @MaxRomanov4669.

Thank you for the fixes. Could I also ask you to declare strict types and use types hinting for method parameters and return types? See the following plugin as an example.

Thank you.

@MaxRomanov4669
Copy link
Contributor Author

Hi @rogyar

I added code fixes but as I see there are new tests for Magento EE. Can you please review these tests?

Thank you.

@rogyar
Copy link
Contributor

rogyar commented Jan 14, 2020

Hi @MaxRomanov4669. The test execution environment is under maintenance at the moment. That's why we might see some failing tests that are not related to our changes somehow.

@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-6602 has been created to process this Pull Request

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Jan 17, 2020

Hi @MaxRomanov4669, 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.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
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