Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function getCustomAttributesMetadata($dataObjectClassName = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCustomAttributesMetadata');
     if (!$pluginInfo) {
         return parent::getCustomAttributesMetadata($dataObjectClassName);
     } else {
         return $this->___callPlugins('getCustomAttributesMetadata', func_get_args(), $pluginInfo);
     }
 }
Esempio n. 2
0
 public function testGetCustomAttributesMetadata()
 {
     $searchCriteriaMock = $this->getMock('Magento\\Framework\\Api\\SearchCriteria', [], [], '', false);
     $this->searchCriteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock);
     $itemMock = $this->getMock('Magento\\Catalog\\Api\\Data\\ProductInterface');
     $this->eavAttributeRepositoryMock->expects($this->once())->method('getList')->with(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE, $searchCriteriaMock)->willReturn($this->searchResultMock);
     $this->searchResultMock->expects($this->once())->method('getItems')->willReturn([$itemMock]);
     $expected = [$itemMock];
     $this->assertEquals($expected, $this->model->getCustomAttributesMetadata());
 }