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

Allow for using Doctrine ORM >=2.6 #9169

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Conversation

pamil
Copy link
Contributor

@pamil pamil commented Feb 8, 2018

No description provided.

@pamil pamil added this to the 1.0 milestone Feb 8, 2018
@pamil pamil self-assigned this Feb 8, 2018
@pamil pamil added Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). Maintenance CI configurations, READMEs, releases, etc. labels Feb 8, 2018
@@ -43,8 +47,9 @@ function it_removes_select_product_attribute_choices(

$productAttribute->getType()->willReturn(SelectAttributeType::TYPE);

$entityManager->getUnitOfWork()->willReturn($unitOfWork);
$unitOfWork->getEntityChangeSet($productAttribute)->willReturn([
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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();
Copy link
Member

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?

Copy link
Contributor Author

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([
Copy link
Member

Choose a reason for hiding this comment

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

Sad but true

@pamil pamil merged commit 743e796 into Sylius:1.0 Feb 8, 2018
@pamil pamil deleted the 1.0-doctrine-2.6 branch February 8, 2018 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). Maintenance CI configurations, READMEs, releases, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants