QuestionQ65

VerifiedAPIs and Services

An Adobe Commerce developer is writing an integration test. They reviewed integration tests for Magento core modules as a reference and noticed that data fixtures are initialized by adding annotations to test classes. For example:

Question Image

The developer wants to add their own fixture to test the MyVendor_MyModule they created. Which steps will make this possible?

Explanation

A file-based integration-test fixture stored in a module belongs in Test/Integration/_files. Its @magentoDataFixture declaration must use the module-relative format, MyVendor_MyModule::Test/Integration/_files/my_fixture.php, so the integration testing framework can resolve and execute the fixture.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!