Example #1
0
 /**
  * {@inheritDoc}
  */
 public function doLoad(ObjectManager $manager)
 {
     $adminRole = new Groups();
     $adminRole->setName('Admin');
     $adminRole->setRole('ROLE_ADMIN');
     $manager->persist($adminRole);
     $systemAdminRole = new Groups();
     $systemAdminRole->setName('System admin');
     $systemAdminRole->setRole('ROLE_SYSTEM_ADMIN');
     $manager->persist($systemAdminRole);
     $userRole = new Groups();
     $userRole->setName('User');
     $userRole->setRole('ROLE_USER');
     $manager->persist($userRole);
     $generalManagerRole = new Groups();
     $generalManagerRole->setName('General manager');
     $generalManagerRole->setRole('ROLE_GENERAL_MANAGER');
     $manager->persist($generalManagerRole);
     $teamManagerRole = new Groups();
     $teamManagerRole->setName('Team manager');
     $teamManagerRole->setRole('ROLE_TEAM_MANAGER');
     $manager->persist($teamManagerRole);
     $stakeholderRole = new Groups();
     $stakeholderRole->setName('Stakeholder');
     $stakeholderRole->setRole('ROLE_STAKEHOLDER');
     $manager->persist($stakeholderRole);
     $payrollRole = new Groups();
     $payrollRole->setName('Payroll');
     $payrollRole->setRole('ROLE_PAYROLL');
     $manager->persist($payrollRole);
     $financeRole = new Groups();
     $financeRole->setName('Finance');
     $financeRole->setRole('ROLE_FINANCE');
     $manager->persist($financeRole);
     $manager->flush();
     $this->addReference('admin-group', $adminRole);
     $this->addReference('system-admin-group', $systemAdminRole);
     $this->addReference('user-group', $userRole);
     $this->addReference('general-manager-group', $generalManagerRole);
     $this->addReference('team-manager-group', $teamManagerRole);
     $this->addReference('stakeholder-group', $stakeholderRole);
     $this->addReference('payroll-group', $payrollRole);
     $this->addReference('finance-group', $financeRole);
 }
 /**
  * testing deleteGroup adction.
  */
 public function testDeleteGroupAction()
 {
     $crawler = $this->client->request('POST', '/secured/admin/groups/delete', array('id' => $this->group->getId()));
     $this->assertTrue($this->client->getResponse()->headers->contains('Content-Type', 'text/html; charset=UTF-8'), 'testDeleteGroupAction: The content-type is not html.');
 }