public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.userRole')->getAll(); foreach ($data as $arr) { $entity = new UserRole(); $entity->setId($arr['id']); $entity->setTitle($arr['title']); $manager->persist($entity); $this->addReference('userRoles' . $arr['id'], $entity); } $manager->flush(); }
/** * @covers Ilios\CoreBundle\Entity\UserRole::__construct */ public function testConstructor() { $this->assertEmpty($this->object->getUsers()); }
public function testGetRole() { $this->object->setTitle('test'); $this->assertEquals('ROLE_test', $this->object->getRole()); }