public function testExecuteEmptyQuery() { $searchString = ""; $this->request->expects($this->once())->method('getParam')->with('q')->will($this->returnValue($searchString)); $this->url->expects($this->once())->method('getBaseUrl'); $this->response->expects($this->once())->method('setRedirect'); $this->controller->execute(); }
public function testExecuteEmptyQuery() { $url = 'some url'; $searchString = ''; $this->request->expects($this->once())->method('getParam')->with('q')->will($this->returnValue($searchString)); $this->url->expects($this->once())->method('getBaseUrl')->willReturn($url); $this->resultRedirectMock->expects($this->once())->method('setUrl')->with($url)->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); } }
/** * {@inheritdoc} */ public function getResponse() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse'); if (!$pluginInfo) { return parent::getResponse(); } else { return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo); } }