CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER, 'frontend_input' => 'select' ], 'attribute' ), DataFixture( AttributeOption::class, [ 'entity_type' => CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER, 'attribute_code' => '$attribute.attribute_code$', 'sort_order' => 10 ], 'option1' ), DataFixture( AttributeOption::class, [ 'entity_type' => CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER, 'attribute_code' => '$attribute.attribute_code$', 'sort_order' => 20 ], 'option2' ), ] public function testMetadata(): void { /** @var AttributeInterface $attribute */ $attribute = DataFixtureStorageManager::getStorage()->get('attribute'); /** @var AttributeOptionInterface $option1 */ $option1 = DataFixtureStorageManager::getStorage()->get('option1'); /** @var AttributeOptionInterface $option2 */ $option2 = DataFixtureStorageManager::getStorage()->get('option2'); $result = $this->graphQlQuery(sprintf(self::QUERY, $attribute->getAttributeCode(), 'customer')); $this->assertEquals( [ 'customAttributeMetadataV2' => [ 'items' => [ [ 'code' => $attribute->getAttributeCode(), 'options' => [ $option1->getData(), $option2->getData() ] ] ], 'errors' => [] ] ], $result ); } }