public function testIndexAction()
 {
     $this->requestMock->expects($this->once())->method('getParam')->with('label_part')->will($this->returnValue('attribute'));
     $this->attributeListMock->expects($this->once())->method('getSuggestedAttributes')->with('attribute')->will($this->returnValue('some_value_for_json'));
     $this->helperMock->expects($this->once())->method('jsonEncode')->with('some_value_for_json')->will($this->returnValue('body'));
     $this->responseMock->expects($this->once())->method('representJson')->with('body');
     $this->suggestAttributes->execute();
 }
Ejemplo n.º 2
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);
     }
 }