Ejemplo n.º 1
0
 public function testRoleListAction()
 {
     $crawler = $this->client->request('GET', "/api/v1/user/rolelist");
     $responseArr = json_decode($this->client->getResponse()->getContent(), true);
     $roles = Role::getRolelist();
     $this->assertTrue($this->client->getResponse()->headers->contains('Content-Type', 'application/json'), $this->client->getResponse()->headers->get('Content-Type'));
     $this->assertEquals(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());
     foreach ($roles as $roleName => $val) {
         $this->assertArrayHasKey($roleName, $responseArr);
     }
 }
Ejemplo n.º 2
0
 protected function getList()
 {
     return Role::getMap();
 }
Ejemplo n.º 3
0
 public function getRoleH()
 {
     $arr = array();
     foreach (Role::getRolelist() as $key => $val) {
         $arr[$key] = substr($this->getRole()->getChmod(), constant("\\Woojin\\UserBundle\\Entity\\Role::{$key}"), 1);
     }
     return $arr;
 }
Ejemplo n.º 4
0
 public function testGetRolelist()
 {
     $rolelist = Role::getRolelist();
     $this->assertTrue(is_array($rolelist));
     $this->assertSame(61, count($rolelist));
 }