21 private $messageInterpretationStrategy;
30 $this->messageManager = $this->getMockBuilder(\
Magento\Framework\Message\ManagerInterface::class)->getMock();
31 $this->messageInterpretationStrategy = $this->createMock(
32 \
Magento\Framework\View\Element\Message\InterpretationStrategyInterface::class
34 $this->
object =
new Messages($this->messageManager, $this->messageInterpretationStrategy);
40 $msgText =
'All is lost';
41 $msg = $this->getMockBuilder(\
Magento\Framework\Message\MessageInterface::class)->getMock();
43 $msgCollection = $this->getMockBuilder(\
Magento\Framework\Message\Collection::class)
46 $msg->expects($this->once())
48 ->willReturn($msgType);
49 $this->messageInterpretationStrategy->expects(static::once())
52 ->willReturn($msgText);
53 $this->messageManager->expects($this->once())
54 ->method(
'getMessages')
56 ->willReturn($msgCollection);
57 $msgCollection->expects($this->once())
59 ->willReturn($messages);
62 [
'messages' => [[
'type' => $msgType,
'text' => $msgText]]],
63 $this->object->getSectionData()