QuestionQ20
Store Operations and AdminAn Architect needs to create an Integration Test that does the following:
- Adds a product through a data fixture.
- Runs
$this->someLogic->execute($product)on the product. - Verifies that the result is
true.
$this->someLogic has the proper object assigned in the setUp() method.
Product creation and the tested logic must run in the contexts of two distinct store views, with IDs 3 and 4, which have been created and are available for the test. How should the Architect satisfy these requirements?
- A Create one test class with one test method. Use the \Magento\TestFramework\Store\ExecuteInStoreContext class once in the fixture and another time in the test.
- B Create two test classes with one test method each. Use the @magentoExecuteInStoreContext 3 and @magentoExecuteInStoreContext 4 annotations on the class level.
- C Create one test class with two test methods. Use the @magentoStoreContext 3 annotation in one method and @magentoStoreContext 4 in the other one.
Community Discussion