public function testDeleteById() { $attributeCode = 'some attribute code'; $attributeMock = $this->getMock('Magento\\Catalog\\Model\\Resource\\Eav\\Attribute', [], [], '', false); $this->eavAttributeRepositoryMock->expects($this->once())->method('get')->with(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE, $attributeCode)->willReturn($attributeMock); $this->attributeResourceMock->expects($this->once())->method('delete')->with($attributeMock); $this->assertEquals(true, $this->model->deleteById($attributeCode)); }
/** * {@inheritdoc} */ public function deleteById($attributeCode) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'deleteById'); if (!$pluginInfo) { return parent::deleteById($attributeCode); } else { return $this->___callPlugins('deleteById', func_get_args(), $pluginInfo); } }