コード例 #1
0
ファイル: LoadUserRoleData.php プロジェクト: profcab/ilios
 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
ファイル: UserRoleTest.php プロジェクト: profcab/ilios
 /**
  * @covers Ilios\CoreBundle\Entity\UserRole::__construct
  */
 public function testConstructor()
 {
     $this->assertEmpty($this->object->getUsers());
 }
コード例 #3
0
ファイル: UserRoleTest.php プロジェクト: stopfstedt/ilios
 public function testGetRole()
 {
     $this->object->setTitle('test');
     $this->assertEquals('ROLE_test', $this->object->getRole());
 }