Indexer dimension mode

Overview

Sets the indexer dimension mode for the test run.

Format

1
2
3
#[
    IndexerDimensionMode(string $indexer, string $dimension)
]

Parameters

  • indexer
    • The name of the indexer code.
  • dimension
    • The name of the dimension mode.

Principles

  1. You can use more than one attribute for a test case or a test method.
  2. Multiple attributes are applied in the given order.
  3. Attributes from different scopes are not merged.
  4. A test method attribute completely overrides a test class attribute.

Test class attribute

An IndexerDimensionMode attribute at the test case level is applied to all tests.

Test method attribute

An IndexerDimensionMode attribute at the test method level configures the test method only. It completely overrides the attribute specified for the test class.

Example

1
2
3
4
5
6
7
8
9
10
#[
   DbIsolation(false),
   IndexerDimensionMode('catalog_product_price', 'website_and_customer_group')
]
class FixedBundlePriceCalculatorWithDimensionTest extends \PHPUnit\Framework\TestCase
{
    public function testPriceForFixedBundle(array $strategyModifiers, array $expectedResults)
    {
    }
}