AD0-E716 · Question #11
An Adobe Commerce developer is writing an integration test. They checked some Integration Tests for Magento core modules for reference and noticed that they use data fixtures initialized by adding…
The correct answer is B. Option B. To add a custom fixture to test a MyVendor_MyModule, the developer needs to do the following: Create a PHP file with the fixture data in [magento root dir]/dev/tests/integration/testsuite/MyVendor/MyModule/_files/my_fixture.php. Add the following annotation to the test method…
Question
Options
- AOption A
- BOption B
- COption C
How the community answered
(22 responses)- A9% (2)
- B77% (17)
- C14% (3)
Explanation
To add a custom fixture to test a MyVendor_MyModule, the developer needs to do the following: Create a PHP file with the fixture data in [magento root dir]/dev/tests/integration/testsuite/MyVendor/MyModule/_files/my_fixture.php. Add the following annotation to the test method: @magentoDataFixture( 'testsuite/MyVendor/MyModule/_files/my_fixture.php' This will tell Magento to load the fixture data from the my_fixture.php file before the test method is
Topics
Community Discussion
No community discussion yet for this question.