group | title |
---|---|
testing |
Using DocBlock Annotations |
DocBlock annotations help to declare context in your code. In addition to built-in PHPUnit annotations, the Integration testing framework provides custom annotations described in this topic.
The following annotations are available in integration tests:
Name | Annotation | Format | Description |
---|---|---|---|
Application Isolation | @magentoAppIsolation |
`@magentoAppIsolation enabled | disabled` |
Configuration Fixture | @magentoConfigFixture |
@magentoConfigFixture [<store_code>_store] <config_path> <config_value> |
Sets up configuration settings for a particular test. The list of settings is stored in the core_config_data database table. After the test execution, the settings revert to their original state. |
Database Isolation | @magentoDbIsolation |
`@magentoDbIsolation enabled | disabled` |
Data Fixture | @magentoDataFixture |
`@magentoDataFixture <script_filename> | <method_name>` |
Application Area | @magentoAppArea |
`@magentoAppArea adminhtml | frontend |
Enable/Disable Cache | @magentoCache |
`@magentoCache | all enabled |
Register Components | @magentoComponentsDir |
@magentoComponentsDir <dir_path> |
Registers fixture components from specified directory (recursively). Unregisters the components after the test is finished. |
The Magento-specific annotations for integration tests are applied in the following order:
@magentoAppIsolation
@magentoDbIsolation
@magentoDataFixture
@magentoComponentsDir
@magentoAppArea
@magentoCache
@magentoConfigFixture
This order is necessary to meet the requirement of setting up the store-scoped configuration values for fixture stores (stores that are created by data fixtures).