Code Duplication    Length = 25-27 lines in 2 locations

app/Containers/Authorization/UI/API/Tests/Functional/ListPermissionsTest.php 1 location

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

app/Containers/Authorization/UI/API/Tests/Functional/ListRolesTest.php 1 location

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