Ejemplo n.º 1
0
 /**
  * @covers Eye4web\ZfcUser\Pm\Service\PmService::newMessage
  */
 public function testNewMessage()
 {
     $conversation = new Conversation();
     $conversation->setHeadLine('foo');
     $message = new Message();
     $message->setMessage('foo');
     $message->setFrom(1);
     $message->setConversation($conversation);
     $user = new User();
     $user->setId(1);
     $this->mapper->expects($this->once())->method('newMessage')->with($conversation, $message, $user)->will($this->returnValue($message));
     $this->mapper->expects($this->any())->method('markUnread')->with($conversation);
     $this->mapper->expects($this->any())->method('markRead')->with($conversation, $user);
     $this->service->newMessage($conversation, $message, $user);
     $this->service->markUnread($conversation);
     $this->service->markRead($conversation, $user);
 }
Ejemplo n.º 2
0
 /**
  * @covers Eye4web\ZfcUser\Pm\Entity\Message::__construct
  * @covers Eye4web\ZfcUser\Pm\Entity\Message::__construct
  */
 public function testConstructSetIdAndDate()
 {
     $message = new Entity();
     $this->assertNotNull($message->getId());
     $this->assertInstanceOf('DateTime', $message->getDate());
 }