예제 #1
0
 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();
 }
예제 #2
0
 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());
 }
예제 #3
0
 /**
  * {@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);
     }
 }
예제 #4
0
 /**
  * {@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);
     }
 }