public function testExecute() { $ids = [1, 2]; $this->request->expects($this->once())->method('getParam')->with('search')->will($this->returnValue($ids)); $this->createQuery(0, 1); $this->createQuery(1, 2); $this->messageManager->expects($this->once())->method('addSuccess')->will($this->returnSelf()); $this->resultRedirectMock->expects($this->once())->method('setPath')->with('search/*/')->willReturnSelf(); $this->assertSame($this->resultRedirectMock, $this->controller->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); } }