magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

`@magentoAppArea` annotation REQUIRED for Controllers Integration Tests

Open lbajsarowicz opened this issue 5 years ago • 3 comments
trafficstars

Rule

Integration Test class should contain

/**
 * @magentoAppArea adminhtml
 */

Reason

This is required annotation to specify the area code for Controllers. Integration Tests fail when it's missing.

Implementation

lbajsarowicz avatar Mar 18 '20 11:03 lbajsarowicz

CC: @lenaorobei We've faced issue related to it when fixing PageBuilder tests.

lbajsarowicz avatar Mar 18 '20 11:03 lbajsarowicz

Hi @lbajsarowicz,

From what I see on DevDocs it does not seem to be required https://devdocs.magento.com/guides/v2.3/test/integration/annotations/magento-app-area.html

Could you please provide more context?

lenaorobei avatar Mar 18 '20 14:03 lenaorobei

When Integration Tests are missing @magentoAppArea it's automatically assumed that it's frontend. So if you refer to adminhtml - this causes failure (router is unable to recognize the route).

Doing so helps avoiding the situations that we already had with PageBuilder IntegrationTests during introducing AbstractInterface.

lbajsarowicz avatar Mar 18 '20 14:03 lbajsarowicz