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

Enable an extending entity to overwrite a requiredEntity binding #806

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

ochnygosch
Copy link
Contributor

Description

In case you extend an entity that has a requiredEntity and add a requiredEntity of the same type, then the requiredEntity of the
base entity is used.
This pull request changes this behaviour, so that the last requiredEntity of that specific type is used. This enables you to change
the content of a requiredEntity when extending an entity.

Sample

<entity name="BaseEntity" type="entity">
    <data key="test">Test</data>
    <requiredEntity type="subentity">BaseSubentity</requiredEntity>
</entity>
<entity name="BaseSubentity" type="subentity">
    <data key="subtest">BaseSubtest</data>
</entity>

<entity name="ExtEntity" type="entity" extends="BaseEntity">
    <requiredEntity type="subentity">ExtSubentity</requiredEntity>
</entity>
<entity name="ExtSubentity" type="subentity">
     <data key="subtest">ExtSubtest</data>
</entity>
Old Result for ExtEntity
{
  "entity" : {
    "test" : "Test",
    "sub" : {
       "subtest" : "BaseSubtest"
    }  
  }
}
New Result for ExtEntity
{
  "entity" : {
    "test" : "Test",
    "sub" : {
       "subtest" : "ExtSubtest"
    }  
  }
}

Fixed Issues (if relevant)

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/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

This enables to overwrite a requiredEntity in an extended entity.
@ochnygosch ochnygosch marked this pull request as ready for review November 13, 2020 12:19
@jilu1
Copy link
Contributor

jilu1 commented Nov 17, 2020

@ochnygosch Thank you for your PR!
Mftf could not resolve entity reference with sample data provided above. Could you please check your sample data and add a verification test if possible before we further process this pr?

@jilu1
Copy link
Contributor

jilu1 commented Nov 18, 2020

@jilu1
Copy link
Contributor

jilu1 commented Dec 4, 2020

@magento import pr to magento-commerce/magento2-functional-testing-framework

@magento-engcom-team
Copy link

@jilu1 the pull request successfully imported.

@jilu1 jilu1 removed the needs update label Dec 4, 2020
@mmansoor-magento mmansoor-magento merged commit 1232cee into magento:develop Dec 10, 2020
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.

4 participants