Example #1
0
 public function testRelationsAreNotReturnedWithData()
 {
     $post = new \SpotTest\Entity\Post(['title' => 'A Post', 'body' => 'A Body', 'status' => 0, 'data' => ['posts' => 'are cool', 'another field' => 'to serialize'], 'date_created' => new \DateTime()]);
     $author = new \SpotTest\Entity\Author(['email' => '*****@*****.**', 'password' => 'password']);
     $post->author = $author;
     $data = $post->data();
     $this->assertFalse(isset($data['author']));
     $array = $post->toArray();
     $this->assertFalse(isset($array['author']));
 }