Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
AttributeManagementTest Class Reference
Inheritance diagram for AttributeManagementTest:

Public Member Functions

 testGetList ()
 

Protected Member Functions

 setUp ()
 

Detailed Description

Definition at line 9 of file AttributeManagementTest.php.

Member Function Documentation

◆ setUp()

setUp ( )
protected

Definition at line 21 of file AttributeManagementTest.php.

22  {
24  $this->model = $this->objectManager->create(\Magento\Eav\Api\AttributeManagementInterface::class);
25  }

◆ testGetList()

testGetList ( )

Verify that collection in service used correctly

Definition at line 30 of file AttributeManagementTest.php.

31  {
32  $productAttributeSetId = $this->getAttributeSetId(
33  \Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE
34  );
35  $productAttributes = $this->model->getAttributes(
36  \Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
37  $productAttributeSetId
38  );
39  // Verify that result contains only product attributes
40  $this->verifyAttributeSetIds($productAttributes, $productAttributeSetId);
41 
42  $categoryAttributeSetId = $this->getAttributeSetId(
43  \Magento\Catalog\Api\Data\CategoryAttributeInterface::ENTITY_TYPE_CODE
44  );
45  $categoryAttributes = $this->model->getAttributes(
46  \Magento\Catalog\Api\Data\CategoryAttributeInterface::ENTITY_TYPE_CODE,
47  $categoryAttributeSetId
48  );
49  // Verify that result contains only category attributes
50  $this->verifyAttributeSetIds($categoryAttributes, $categoryAttributeSetId);
51  }

The documentation for this class was generated from the following file: