public function testNotNullValidation() { $notNulls = array('user'); $this->object->setDueDate(new \DateTime()); $this->validateNotNulls($notNulls); $this->object->setUser(m::mock('Ilios\\CoreBundle\\Entity\\UserInterface')); $this->validate(0); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.userMadeReminder')->getAll(); foreach ($data as $arr) { $entity = new UserMadeReminder(); $entity->setId($arr['id']); $entity->setNote($arr['note']); $entity->setDueDate(new \DateTime($arr['dueDate'])); $entity->setUser($this->getReference('users' . $arr['user'])); $manager->persist($entity); $this->addReference('userMadeReminders' . $arr['id'], $entity); } $manager->flush(); }