GetAllPermissionsTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 28
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetAllPermissions_() 13 13 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace App\Containers\Authorization\UI\API\Tests\Functional;
4
5
use App\Containers\Authorization\Tests\ApiTestCase;
6
7
/**
8
 * Class GetAllPermissionsTest.
9
 *
10
 * @group authorization
11
 * @group api
12
 *
13
 * @author  Mahmoud Zalt <[email protected]>
14
 */
15 View Code Duplication
class GetAllPermissionsTest extends ApiTestCase
0 ignored issues
show
Duplication introduced by Mahmoud Zalt
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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