Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 16-44 (lines=29) @@
13
 *
14
 * @author  Mahmoud Zalt <[email protected]>
15
 */
16
class FindPermissionTest extends ApiTestCase
17
{
18
19
    protected $endpoint = '[email protected]/permissions/{id}';
20
21
    protected $access = [
22
        'roles'       => '',
23
        'permissions' => 'manage-roles',
24
    ];
25
26
    /**
27
     * @test
28
     */
29
    public function testFindPermissionById_()
30
    {
31
        $permissionA = factory(Permission::class)->create();
32
33
        // send the HTTP request
34
        $response = $this->injectId($permissionA->id)->makeCall();
35
36
        // assert response status is correct
37
        $response->assertStatus(200);
38
39
        $responseContent = $this->getResponseContentObject();
40
41
        $this->assertEquals($permissionA->name, $responseContent->data->name);
42
    }
43
44
}
45

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

@@ 16-44 (lines=29) @@
13
 *
14
 * @author  Mahmoud Zalt <[email protected]>
15
 */
16
class FindRoleTest extends ApiTestCase
17
{
18
19
    protected $endpoint = '[email protected]/roles/{id}';
20
21
    protected $access = [
22
        'roles'       => '',
23
        'permissions' => 'manage-roles',
24
    ];
25
26
    /**
27
     * @test
28
     */
29
    public function testFindRoleById_()
30
    {
31
        $roleA = factory(Role::class)->create();
32
33
        // send the HTTP request
34
        $response = $this->injectId($roleA->id)->makeCall();
35
36
        // assert response status is correct
37
        $response->assertStatus(200);
38
39
        $responseContent = $this->getResponseContentObject();
40
41
        $this->assertEquals($roleA->name, $responseContent->data->name);
42
    }
43
44
}
45