public function testExtract()
 {
     $data = ['messageId' => 1, 'newsletterId' => 1, 'templateId' => 1, 'subject' => 'Test', 'params' => 'test=test', 'message' => '<h1>Message</h1>', 'sent' => 1, 'dateCreated' => '2016-02-19 18:12:21', 'dateSent' => '2016-02-19 18:12:21'];
     $object = new MessageModel();
     $object->setMessageId($data['messageId'])->setNewsletterId($data['newsletterId'])->setTemplateId($data['templateId'])->setSubject($data['subject'])->setParams($data['params'])->setMessage($data['message'])->setSent(true)->setDateCreated(new \DateTime($data['dateCreated']))->setDateSent(new \DateTime($data['dateSent']));
     $hydrator = new Message();
     $model = $hydrator->hydrate($data, new MessageModel());
     $this->assertEquals($object, $model);
     $this->assertSame($data, $hydrator->extract($model));
 }
 public function testSetGetMessageId()
 {
     $this->model->setMessageId(1);
     $this->assertSame(1, $this->model->getMessageId());
 }