-
-
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
Allow for using Doctrine ORM >=2.6 #9169
Conversation
@@ -43,8 +47,9 @@ function it_removes_select_product_attribute_choices( | |||
|
|||
$productAttribute->getType()->willReturn(SelectAttributeType::TYPE); | |||
|
|||
$entityManager->getUnitOfWork()->willReturn($unitOfWork); | |||
$unitOfWork->getEntityChangeSet($productAttribute)->willReturn([ |
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.
Need to use Mockery for UnitOfWork mock as Doctrine ORM 2.6 changes getEntityChangeSet
definition to return a reference instead of a value and it's no supported by Prophecy.
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.
To be honest this spec should be rewritten to follow "don't mock what you don't own" rule and behaviour tested by Behat scenarios, but this one is the quickest solution, allows us to install Doctrine ORM 2.6 and fixes the error seen in #9164.
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.
Sad but true
->shouldNotBeCalled() | ||
; | ||
$entityManager->getUnitOfWork()->willReturn($unitOfWork); | ||
$entityManager->getRepository('Sylius\Component\Product\Model\ProductAttributeValue')->shouldNotBeCalled(); |
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.
Is there any reason for not using ProductAttributeValue::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.
Not really, just wanted not to change too much as I would rather rewrite the whole test instead :)
@@ -43,8 +47,9 @@ function it_removes_select_product_attribute_choices( | |||
|
|||
$productAttribute->getType()->willReturn(SelectAttributeType::TYPE); | |||
|
|||
$entityManager->getUnitOfWork()->willReturn($unitOfWork); | |||
$unitOfWork->getEntityChangeSet($productAttribute)->willReturn([ |
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.
Sad but true
No description provided.