Allow for using Doctrine ORM >=2.6#9169
Conversation
| $productAttribute->getType()->willReturn(SelectAttributeType::TYPE); | ||
|
|
||
| $entityManager->getUnitOfWork()->willReturn($unitOfWork); | ||
| $unitOfWork->getEntityChangeSet($productAttribute)->willReturn([ |
There was a problem hiding this comment.
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.
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.
| ->shouldNotBeCalled() | ||
| ; | ||
| $entityManager->getUnitOfWork()->willReturn($unitOfWork); | ||
| $entityManager->getRepository('Sylius\Component\Product\Model\ProductAttributeValue')->shouldNotBeCalled(); |
There was a problem hiding this comment.
Is there any reason for not using ProductAttributeValue::class?
There was a problem hiding this comment.
Not really, just wanted not to change too much as I would rather rewrite the whole test instead :)
| $productAttribute->getType()->willReturn(SelectAttributeType::TYPE); | ||
|
|
||
| $entityManager->getUnitOfWork()->willReturn($unitOfWork); | ||
| $unitOfWork->getEntityChangeSet($productAttribute)->willReturn([ |
No description provided.