| @@ 13-34 (lines=22) @@ | ||
| 10 | * |
|
| 11 | * @author Mahmoud Zalt <[email protected]> |
|
| 12 | */ |
|
| 13 | class ListPermissionsTest extends TestCase |
|
| 14 | { |
|
| 15 | ||
| 16 | private $endpoint = '/permissions'; |
|
| 17 | ||
| 18 | public function testListAllPermissions_() |
|
| 19 | { |
|
| 20 | $admin = $this->getLoggedInTestingAdmin(); |
|
| 21 | ||
| 22 | // send the HTTP request |
|
| 23 | $response = $this->apiCall($this->endpoint, 'get'); |
|
| 24 | ||
| 25 | // assert response status is correct |
|
| 26 | $this->assertEquals($response->getStatusCode(), '200'); |
|
| 27 | ||
| 28 | // convert JSON response string to Object |
|
| 29 | $responseObject = $this->getResponseObject($response); |
|
| 30 | ||
| 31 | $this->assertTrue(count($responseObject->data) > 0); |
|
| 32 | } |
|
| 33 | ||
| 34 | } |
|
| 35 | ||
| @@ 13-34 (lines=22) @@ | ||
| 10 | * |
|
| 11 | * @author Mahmoud Zalt <[email protected]> |
|
| 12 | */ |
|
| 13 | class ListRolesTest extends TestCase |
|
| 14 | { |
|
| 15 | ||
| 16 | private $endpoint = '/roles'; |
|
| 17 | ||
| 18 | public function testListAllRoles_() |
|
| 19 | { |
|
| 20 | $admin = $this->getLoggedInTestingAdmin(); |
|
| 21 | ||
| 22 | // send the HTTP request |
|
| 23 | $response = $this->apiCall($this->endpoint, 'get'); |
|
| 24 | ||
| 25 | // assert response status is correct |
|
| 26 | $this->assertEquals($response->getStatusCode(), '200'); |
|
| 27 | ||
| 28 | // convert JSON response string to Object |
|
| 29 | $responseObject = $this->getResponseObject($response); |
|
| 30 | ||
| 31 | $this->assertTrue(count($responseObject->data) > 0); |
|
| 32 | } |
|
| 33 | ||
| 34 | } |
|
| 35 | ||