public function testExecuteWithException() { $customersIds = [10, 11, 12]; $this->customerCollectionMock->expects($this->any())->method('getAllIds')->willReturn($customersIds); $this->customerRepositoryMock->expects($this->any())->method('getById')->willThrowException(new \Exception('Some message.')); $this->messageManagerMock->expects($this->once())->method('addError')->with('Some message.'); $this->massAction->execute(); }
/** * {@inheritdoc} */ public function dispatch(\Magento\Framework\App\RequestInterface $request) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch'); if (!$pluginInfo) { return parent::dispatch($request); } else { return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo); } }