QuestionQ6

Utilize Commerce test frameworks throughout the whole workflow

An Adobe Commerce Architect designs and implements functionality that adds a new Complex Product Type to an existing Adobe Commerce website. In addition to a visual demonstration of the new product type, the changes include price-index adjustments.

The website uses a multi-dimensional indexer feature to store the price index. The Architect decides to cover this with integration tests. After creating and running one test, the Architect finds that database storage is not fully cleaned.

The test method includes the following annotation declaration:

Question Image

Which change should the Architect make to resolve this issue?

  • A Add annotation @magentoAppIsolation enabled to method PHPDoc
  • B Modify method PHPDoc and change annotation @magentoDbIsoiation to enabled
  • C Create Custom_ProductType::Test/_files/{fixture_name}_rollback.php for every fixture
Explanation

Enabling @magentoDbIsolation causes the Commerce integration-test framework to start a database transaction, avoid committing test changes, and restore the database after the test. The current disabled setting permits fixture and reindexing data to persist. Application isolation only reinitializes application state and does not provide database cleanup.

Learn more

Community Discussion

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