public function testNotificationParsing() { $replacement = ['bracket' => '123', 'Test_Var153' => 'Var2']; $message = 'Testing {bracket} test abc {Test_Var153} {unknown}'; $finalMessage = 'Testing 123 test abc Var2 {unknown}'; $this->notification->method('getMessageTemplate')->willReturn($message); $this->notification->expects($this->any())->method('setMessage')->will($this->returnCallback(function ($message) { $this->notification->method('getMessage')->willReturn($message); })); $parser = new Parser(); $parser->parse($this->notification, $replacement); $this->assertSame($finalMessage, $this->notification->getMessage()); }
/** * Parse notification message * * @param \Monitor\Model\Notification $notification * @param array $data */ private function parseNotification(Notification $notification, $data) { $this->notificationParser->parse($notification, $data); }