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

Module data fixtures for @magentoDataFixtureBeforeTransaction annotations #21465

Merged
merged 3 commits into from
Mar 30, 2019

Conversation

Vinai
Copy link
Contributor

@Vinai Vinai commented Feb 26, 2019

Description (*)

Extend the option to specify a module based data fixture files for integration tests to the @magentoDataFixtureBeforeTransaction annotation.
Previously they where only available for the @magentoDataFixture annotation.

The syntax is the same:

@magentoDataFixtureBeforeAnnotation Foo_DataFixtureDummy::Test/Integration/foo.php

There is no backward compatibility break associated with this commit.

The PR also adds previously missing test coverage for same functionality for the @magentoDataFixture test annotation. Since the code from this PR is identical to that code, I decided against adding a test for @magentoDataFixtureBeforeTransaction, too.

Fixed Issues (if relevant)

There is no relevant open issue I'm aware of.

Manual testing scenarios (*)

  1. Create module
  2. Create a Integration Test within the module
  3. Add a annotation pointing to a file within the module, for example:
    @magentoDataFixtureBeforeTransaction Magento_InventoryCatalog::Test/_file/products_all_types.php
  4. Run the test and observe the fixture being applied.

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/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @Vinai. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

Hi @larsroettig, thank you for the review.
ENGCOM-4384 has been created to process this Pull Request

…nnotations

Extend the option to specify a module based data fixture files to the
@magentoDataFixtureBeforeTransaction annotation.
Previously they where only available for the @magentoDataFixture annotation.

The syntax is the same:
@magentoDataFixtureBeforeAnnotation Foo_DataFixtureDummy::Test/Integration/foo.php

There is no backward compatibility break associated with this commit.
@Vinai
Copy link
Contributor Author

Vinai commented Feb 27, 2019

Thanks for your review @larsroettig. I've added a @SuppressWarnings(PHPMD.StaticAccess) to the testModuleDataFixture test so the static code analysis doesn't complain.

@magento-engcom-team magento-engcom-team merged commit 749551f into magento:2.3-develop Mar 30, 2019
@m2-assistant
Copy link

m2-assistant bot commented Mar 30, 2019

Hi @Vinai, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

5 participants