public function testExecuteWithoutData() { $this->request->expects($this->at(0))->method('getParam')->with('isAjax')->willReturn(true); $this->request->expects($this->at(1))->method('getParam')->with('items', [])->willReturn([]); $this->jsonFactory->expects($this->once())->method('create')->willReturn($this->resultJson); $this->resultJson->expects($this->once())->method('setData')->with(['messages' => ['Please correct the data sent.'], 'error' => true])->willReturnSelf(); $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); } }