private function addSystemMessageMessages()
 {
     switch ($this->manager->getSystemMessageOp()) {
         case Manager\Campaign::SYSTEM_MESSAGE_UPDATED:
             $msg = $this->userText->getMessage(EntityName::MESSAGE, Message::UPDATE_SUCCESS);
             $this->flashMessenger()->addSuccessMessage($msg);
             break;
         case Manager\Campaign::SYSTEM_MESSAGE_CREATED:
             $msg = $this->userText->getMessage(EntityName::MESSAGE, Message::CREATE_SUCCESS);
             $this->flashMessenger()->addSuccessMessage($msg);
             break;
         case Manager\Campaign::SYSTEM_MESSAGE_DELETED:
             $msg = $this->userText->getMessage(EntityName::MESSAGE, Message::DELETE_SUCCESS);
             $this->flashMessenger()->addSuccessMessage($msg);
             break;
     }
 }
Example #2
0
 /**
  * @TODO   Remove when Handle system message is moved to an event
  *
  * @covers DmMailer\Manager\Campaign
  */
 public function testHandleSystemMessageSkipsMessageOperation()
 {
     $this->formMock->expects($this->any())->method('isValid')->willReturn(true);
     $this->formMock->expects($this->any())->method('get')->willReturn($this->getInputMock());
     $this->requestMock->expects($this->any())->method('isPost')->willReturn(true);
     $this->requestMock->expects($this->any())->method('getPost')->willReturn([]);
     // Actual test
     $this->messageMock->expects($this->any())->method('getBody')->willReturn('');
     $this->messageMock->expects($this->any())->method('getSubject')->willReturn('');
     $this->messageMock->expects($this->any())->method('getId')->willReturn(0);
     // End of actual test
     $actualResult = $this->sut->handlePost($this->campaignMock, $this->messageMock);
     $this->assertTrue($actualResult);
     $this->assertEquals(Campaign::SYSTEM_MESSAGE_SKIPPED, $this->sut->getSystemMessageOp());
 }