public function testInterpretNoInterpreterException() { $identifier = 'Prophesy'; $messageConfiguration = ['renderer' => 'Third apostle from the left', 'data' => ['Blessed are the birds...']]; $this->messageMock->expects(static::once())->method('getIdentifier')->willReturn($identifier); $this->messageConfigurationsPool->expects(static::once())->method('getMessageConfiguration')->with($identifier)->willReturn($messageConfiguration); $this->renderersPool->expects(static::once())->method('get')->with($messageConfiguration['renderer'])->willReturn(null); $this->setExpectedException('LogicException'); $this->interpretationStrategy->interpret($this->messageMock); }
/** * Interpret message * * @param MessageInterface $message * @return string */ public function interpret(MessageInterface $message) { if ($message->getIdentifier()) { try { return $this->interpretationStrategy->interpret($message); } catch (\LogicException $e) { // pass } } return $message->getText(); }