/** * {@inheritdoc} */ public function deleteById($customerId) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'deleteById'); if (!$pluginInfo) { return parent::deleteById($customerId); } else { return $this->___callPlugins('deleteById', func_get_args(), $pluginInfo); } }
public function testDeleteById() { $customerId = 14; $customerModel = $this->getMock('Magento\\Customer\\Model\\Customer', ['delete'], [], '', false); $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->deleteById($customerId)); }