public function testDateSetter() { $entity = new Entity(); $entity->id = 2; $entity->date = Carbon::createFromDate(2015, 1, 1); $this->em->persist($entity); $this->em->flush(); }