Ejemplo n.º 1
0
 /**
  * @testdox Test the service's methods.
  *
  * @dataProvider hierarchyProvider
  *
  * @param array $hierarchy
  * @param array $expected
  */
 public function testService(array $hierarchy, array $expected)
 {
     $service = new UserRoles($hierarchy);
     $this->assertEquals($expected, $service->getRoles());
 }
Ejemplo n.º 2
0
 /**
  * The first call generate unique values. This is to ensure all values are called before generating duplicates.
  *
  * @return string Random Symfony role.
  *
  * TODO: take into account users hierarchy too!
  */
 public function userRole()
 {
     return BaseProvider::randomElement($this->userRoles->getRoles());
 }