public function setUp() { $this->em = $this->db('ORM')->getOm(); $this->purgeDatabase(); $this->aclProvider = $this->getContainer()->get('security.acl.provider'); $this->role = new Role(); $this->role->setName('Administrator'); $this->role->setSystem('Sulu'); $this->em->persist($this->role); $this->em->flush(); }
/** * Sets the securityType from the given data to the role. * * @param RoleInterface $role * @param $securityTypeData * * @throws \Sulu\Component\Rest\Exception\EntityNotFoundException */ private function setSecurityType($role, $securityTypeData) { $securityType = $this->getDoctrine()->getRepository('SuluSecurityBundle:SecurityType')->findSecurityTypeById($securityTypeData['id']); if (!$securityType) { throw new EntityNotFoundException('SuluSecurityBundle:SecurityType', $securityTypeData['id']); } $role->setSecurityType($securityType); }