Code Duplication    Length = 28-30 lines in 2 locations

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

@@ 15-42 (lines=28) @@
12
 *
13
 * @author  Mahmoud Zalt <[email protected]>
14
 */
15
class GetAllPermissionsTest extends ApiTestCase
16
{
17
18
    protected $endpoint = '[email protected]/permissions';
19
20
    protected $access = [
21
        'roles'       => '',
22
        'permissions' => 'manage-roles',
23
    ];
24
25
    /**
26
     * @test
27
     */
28
    public function testGetAllPermissions_()
29
    {
30
        // send the HTTP request
31
        $response = $this->makeCall();
32
33
        // assert response status is correct
34
        $response->assertStatus(200);
35
36
        // convert JSON response string to Object
37
        $responseContent = $this->getResponseContentObject();
38
39
        $this->assertTrue(count($responseContent->data) > 0);
40
    }
41
42
}
43

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

@@ 15-44 (lines=30) @@
12
 *
13
 * @author  Mahmoud Zalt <[email protected]>
14
 */
15
class GetAllRolesTest extends ApiTestCase
16
{
17
18
    protected $endpoint = '[email protected]/roles';
19
20
    protected $access = [
21
        'roles'       => '',
22
        'permissions' => 'manage-roles',
23
    ];
24
25
    /**
26
     * @test
27
     */
28
    public function testGetAllRoles_()
29
    {
30
        $this->getTestingUser();
31
32
        // send the HTTP request
33
        $response = $this->makeCall();
34
35
        // assert response status is correct
36
        $response->assertStatus(200);
37
38
        // convert JSON response string to Object
39
        $responseContent = $this->getResponseContentObject();
40
41
        $this->assertTrue(count($responseContent->data) > 0);
42
    }
43
44
}
45