public function testFormatUrlKey() { $strIn = 'Some string'; $resultString = 'some'; $this->filter->expects($this->once())->method('translitUrl')->with($strIn)->will($this->returnValue($resultString)); $this->assertEquals($resultString, $this->model->formatUrlKey($strIn)); }
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(); }