示例#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);
     }
 }
示例#2
0
 protected function getList()
 {
     return Role::getMap();
 }
示例#3
0
文件: User.php 项目: jocoonopa/avenue
 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;
 }
示例#4
0
 public function testGetRolelist()
 {
     $rolelist = Role::getRolelist();
     $this->assertTrue(is_array($rolelist));
     $this->assertSame(61, count($rolelist));
 }