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); } }
protected function getList() { return Role::getMap(); }
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; }
public function testGetRolelist() { $rolelist = Role::getRolelist(); $this->assertTrue(is_array($rolelist)); $this->assertSame(61, count($rolelist)); }