/** * {@inheritdoc} */ public function delete(\Magento\Customer\Api\Data\CustomerInterface $customer) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'delete'); if (!$pluginInfo) { return parent::delete($customer); } else { return $this->___callPlugins('delete', func_get_args(), $pluginInfo); } }
public function testDelete() { $customerId = 14; $customerModel = $this->getMock('Magento\\Customer\\Model\\Customer', ['delete'], [], '', false); $this->customer->expects($this->once())->method('getId')->willReturn($customerId); $this->customerRegistry->expects($this->once())->method('retrieve')->with($customerId)->willReturn($customerModel); $customerModel->expects($this->once())->method('delete'); $this->customerRegistry->expects($this->once())->method('remove')->with($customerId); $this->assertTrue($this->model->delete($this->customer)); }