Example #1
0
 public function testCreateMessageViaMassAssignment()
 {
     $mess = Message::create(['message' => 'Random phpunit test message', 'send_to' => $this->char_id, 'send_from' => $this->char_id_2, 'unread' => 1]);
     $text = 'Updated phpunit test message';
     $mess->message = $text;
     $mess->save();
     // Save the newly updated message
     $id = $mess->id();
     $retrieved_message = Message::find($id);
     $retrieved_text = $retrieved_message->message;
     $retrieved_message->delete();
     $this->assertEquals($text, $retrieved_text);
 }