CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER ], 'attribute' ) ] public function testTextField(): void { /** @var AttributeInterface $attribute */ $attribute = DataFixtureStorageManager::getStorage()->get('attribute'); $this->assertEquals( [ 'customAttributeMetadataV2' => [ 'items' => [ [ 'code' => $attribute->getAttributeCode(), 'label' => $attribute->getDefaultFrontendLabel(), 'entity_type' => 'CUSTOMER', 'frontend_input' => 'TEXT', 'is_required' => false, 'default_value' => $attribute->getDefaultValue(), 'is_unique' => false ] ], 'errors' => [] ] ], $this->graphQlQuery(sprintf(self::QUERY, $attribute->getAttributeCode(), 'customer')) ); } public function testErrorEntityNotFound(): void { $this->assertEquals( [ 'customAttributeMetadataV2' => [ 'items' => [], 'errors' => [ [ 'type' => 'ENTITY_NOT_FOUND', 'message' => 'Entity "non_existing_entity_type" could not be found.' ] ] ] ], $this->graphQlQuery( sprintf( self::QUERY, 'lastname', 'non_existing_entity_type' ) ) ); } public function testErrorAttributeNotFound(): void { $this->assertEquals( [ 'customAttributeMetadataV2' => [ 'items' => [], 'errors' => [ [ 'type' => 'ATTRIBUTE_NOT_FOUND', 'message' => 'Attribute code "non_existing_code" could not be found.' ] ] ] ], $this->graphQlQuery( sprintf( self::QUERY, 'non_existing_code', 'customer' ) ) ); } }