public function testRenderIfInlineTranslationIsNotAllowed() { $text = 'test'; $inlineTranslate = $this->getMock('Magento\\Framework\\Translate\\InlineInterface', [], [], '', []); $inlineTranslate->expects($this->once())->method('isAllowed')->will($this->returnValue(false)); $this->provider->expects($this->once())->method('get')->will($this->returnValue($inlineTranslate)); $this->assertEquals($text, $this->renderer->render([$text], [])); }
public function testRenderException() { $message = 'something went wrong'; $exception = new \Exception($message); $this->provider->expects($this->once())->method('get')->willThrowException($exception); $this->setExpectedException('Exception', $message); $this->renderer->render(['text'], []); }