/**
  * @param string $message
  * @param array $data
  *
  * @return $this
  */
 protected function addSuccessMessage($message, array $data = [])
 {
     $messageObject = new Message();
     $messageObject->setMessage($message);
     $messageObject->setData($data);
     $this->successMessages[] = $messageObject;
     return $this;
 }
Beispiel #2
0
 /**
  * @return void
  */
 public function testGetterAndSetters()
 {
     $message = new Message();
     $message->setData(['test' => 'test']);
     $message->setMessage('message');
     $this->assertEquals('message', $message->getMessage());
     $this->assertEquals(['test' => 'test'], $message->getData());
     $this->assertEquals(['message' => 'message', 'data' => ['test' => 'test']], $message->toArray());
 }