예제 #1
0
 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();
 }
예제 #2
0
 /**
  * @covers Ilios\CoreBundle\Entity\UserRole::__construct
  */
 public function testConstructor()
 {
     $this->assertEmpty($this->object->getUsers());
 }
예제 #3
0
 public function testGetRole()
 {
     $this->object->setTitle('test');
     $this->assertEquals('ROLE_test', $this->object->getRole());
 }