-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Admin][ProductAssociation] Adding associated products to a product #6642
[Admin][ProductAssociation] Adding associated products to a product #6642
Conversation
GSadee
commented
Nov 7, 2016
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Related tickets | - |
License | MIT |
b8d568e
to
fc0dd4a
Compare
And I remove an associated product "LG earphones" from "Accessories" | ||
And I add it | ||
Then I should be notified that it has been successfully created | ||
And this product should have an association "Accessories" with product "LG headphones" |
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.
Missing And this product should not have an association "Accessories" with product "LG earphones"
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.
Added 👍
And I remove an associated product "LG earphones" from "Accessories" | ||
And I save my changes | ||
Then I should be notified that it has been successfully edited | ||
And this product should have an association "Accessories" with product "LG headphones" |
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.
And this product should not have an association "Accessories" with product "LG earphones"
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.
Added 👍
'%association%' => $productAssociationType->getName(), | ||
'%item%' => $productName, | ||
]); | ||
$item->find('css', 'i.delete')->click(); |
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.
find
can return null
we should assert before click
@GSadee rebase required. |
fc0dd4a
to
f3c6d09
Compare
e35193c
to
3286609
Compare
$this->setProductAssociations($productAssociations); | ||
|
||
if (null === $productAssociations) { | ||
return null; |
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.
By convention of DataTransformerInterface
, this should be return '';
/** | ||
* @Given /^the (product "[^"]+") has(?:| also) an (association "[^"]+") with (product "[^"]+")$/ | ||
*/ | ||
public function theProductHasAnAssociationWithProduct( |
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 method could be merged with the method below if we would use variadics
3286609
to
8a0a3c9
Compare
) { | ||
/** @var UpdateSimpleProductPageInterface|UpdateConfigurableProductPageInterface $currentPage */ | ||
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([ | ||
$this->createSimpleProductPage, |
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.
Do the assosciation work only on simple product page?
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 don't think that testing that also on configurable product page has a business value, because the logic is the same.
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.
Sure, but we have generic steep, which can be used with both with simple or configurable product.
/** | ||
* @var FactoryInterface | ||
*/ | ||
protected $productAssociationFactory; |
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.
Class is final so methods should be private
…ociations of a product
… changing associations
8a0a3c9
to
a029676
Compare
Good job Grzesiu! 👍 |