Пример #1
0
 public function testExecute()
 {
     $firstElement = 'firstElement';
     $symbolsDataArray = [$firstElement];
     $redirectUrl = 'redirectUrl';
     $this->requestMock->expects($this->once())->method('getParam')->with('custom_currency_symbol')->willReturn($symbolsDataArray);
     $this->helperMock->expects($this->once())->method('getUrl')->with('*');
     $this->redirectMock->expects($this->once())->method('getRedirectUrl')->willReturn($redirectUrl);
     $this->currencySymbolMock->expects($this->once())->method('setCurrencySymbolsData')->with($symbolsDataArray);
     $this->responseMock->expects($this->once())->method('setRedirect');
     $this->filterManagerMock->expects($this->once())->method('stripTags')->with($firstElement)->willReturn($firstElement);
     $this->objectManagerMock->expects($this->once())->method('create')->with('Magento\\CurrencySymbol\\Model\\System\\Currencysymbol')->willReturn($this->currencySymbolMock);
     $this->objectManagerMock->expects($this->once())->method('get')->with('Magento\\Framework\\Filter\\FilterManager')->willReturn($this->filterManagerMock);
     $this->messageManagerMock->expects($this->once())->method('addSuccess')->with(__('You applied the custom currency symbols.'));
     $this->action->execute();
 }
Пример #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);
     }
 }